parent
86edd0381c
commit
19703617b8
2 changed files with 15 additions and 1 deletions
|
@ -147,6 +147,11 @@ class ActionModule(object):
|
||||||
dest=dest,
|
dest=dest,
|
||||||
original_basename=os.path.basename(src),
|
original_basename=os.path.basename(src),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# make sure checkmod is passed on correctly
|
||||||
|
if self.runner.noop_on_check(inject):
|
||||||
|
new_module_args['CHECKMODE'] = True
|
||||||
|
|
||||||
module_args_tmp = utils.merge_module_args(module_args, new_module_args)
|
module_args_tmp = utils.merge_module_args(module_args, new_module_args)
|
||||||
|
|
||||||
return self.runner._execute_module(conn, tmp, 'file', module_args_tmp, inject=inject)
|
return self.runner._execute_module(conn, tmp, 'file', module_args_tmp, inject=inject)
|
||||||
|
|
|
@ -77,13 +77,22 @@ class ActionModule(object):
|
||||||
# fix file permissions when the copy is done as a different user
|
# fix file permissions when the copy is done as a different user
|
||||||
if copy:
|
if copy:
|
||||||
if self.runner.sudo and self.runner.sudo_user != 'root' or self.runner.su and self.runner.su_user != 'root':
|
if self.runner.sudo and self.runner.sudo_user != 'root' or self.runner.su and self.runner.su_user != 'root':
|
||||||
|
if not self.runner.noop_on_check(inject):
|
||||||
self.runner._remote_chmod(conn, 'a+r', tmp_src, tmp)
|
self.runner._remote_chmod(conn, 'a+r', tmp_src, tmp)
|
||||||
# Build temporary module_args.
|
# Build temporary module_args.
|
||||||
new_module_args = dict(
|
new_module_args = dict(
|
||||||
src=tmp_src,
|
src=tmp_src,
|
||||||
original_basename=os.path.basename(source),
|
original_basename=os.path.basename(source),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# make sure checkmod is passed on correctly
|
||||||
|
if self.runner.noop_on_check(inject):
|
||||||
|
new_module_args['CHECKMODE'] = True
|
||||||
|
|
||||||
module_args = utils.merge_module_args(module_args, new_module_args)
|
module_args = utils.merge_module_args(module_args, new_module_args)
|
||||||
else:
|
else:
|
||||||
module_args = "%s original_basename=%s" % (module_args, pipes.quote(os.path.basename(source)))
|
module_args = "%s original_basename=%s" % (module_args, pipes.quote(os.path.basename(source)))
|
||||||
|
# make sure checkmod is passed on correctly
|
||||||
|
if self.runner.noop_on_check(inject):
|
||||||
|
module_args += " CHECKMODE=True"
|
||||||
return self.runner._execute_module(conn, tmp, 'unarchive', module_args, inject=inject, complex_args=complex_args)
|
return self.runner._execute_module(conn, tmp, 'unarchive', module_args, inject=inject, complex_args=complex_args)
|
||||||
|
|
Loading…
Reference in a new issue