mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
file_map: chmod created directories if not root
This commit is contained in:
parent
13facbf077
commit
fe3a762673
1 changed files with 7 additions and 0 deletions
|
@ -1084,6 +1084,13 @@ def deploy_script(host,
|
|||
|
||||
if remote_dir not in remote_dirs:
|
||||
root_cmd('mkdir -p \'{0}\''.format(remote_dir), tty, sudo, **ssh_kwargs)
|
||||
if ssh_kwargs['username'] != 'root':
|
||||
root_cmd(
|
||||
'chown {0} \'{1}\''.format(
|
||||
ssh_kwargs['username'], remote_dir
|
||||
),
|
||||
tty, sudo, **ssh_kwargs
|
||||
)
|
||||
remote_dirs.append(remote_dir)
|
||||
sftp_file(
|
||||
remote_file, kwargs=ssh_kwargs, local_file=local_file
|
||||
|
|
Loading…
Add table
Reference in a new issue