mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #1018 from willthames/template_perms
Fix templates for non root sudo_user
This commit is contained in:
commit
0709c48f64
1 changed files with 4 additions and 1 deletions
|
@ -70,7 +70,10 @@ class ActionModule(object):
|
||||||
return ReturnData(conn=conn, comm_ok=False, result=result)
|
return ReturnData(conn=conn, comm_ok=False, result=result)
|
||||||
|
|
||||||
xfered = self.runner._transfer_str(conn, tmp, 'source', resultant)
|
xfered = self.runner._transfer_str(conn, tmp, 'source', resultant)
|
||||||
|
# fix file permissions when the copy is done as a different user
|
||||||
|
if self.runner.sudo and self.runner.sudo_user != 'root':
|
||||||
|
self.runner._low_level_exec_command(conn, "chmod a+r %s" % xfered,
|
||||||
|
tmp)
|
||||||
# run the copy module, queue the file module
|
# run the copy module, queue the file module
|
||||||
self.runner.module_args = "%s src=%s dest=%s" % (self.runner.module_args, xfered, dest)
|
self.runner.module_args = "%s src=%s dest=%s" % (self.runner.module_args, xfered, dest)
|
||||||
return self.runner._execute_module(conn, tmp, 'copy', self.runner.module_args, inject=inject).daisychain('file')
|
return self.runner._execute_module(conn, tmp, 'copy', self.runner.module_args, inject=inject).daisychain('file')
|
||||||
|
|
Loading…
Reference in a new issue