copy: Handle "no copy/propagate attrs only" for recursive mode well.

For this, add internal "original_basename" param to file module,
similar to copy module. (Param name is a bit misnormer now, should
be treated as "original basepath").
This commit is contained in:
Paul Sokolovsky 2013-10-14 22:10:27 +03:00
parent ce88df3cf4
commit 2e668f14f7
2 changed files with 8 additions and 2 deletions

View file

@ -217,7 +217,8 @@ class ActionModule(object):
if raw:
# don't send down raw=no
module_args.pop('raw')
module_args_tmp = "%s src=%s" % (module_args, pipes.quote(tmp_src))
module_args_tmp = "%s src=%s original_basename=%s" % (module_args,
pipes.quote(tmp_src), pipes.quote(source_rel))
if self.runner.noop_on_check(inject):
module_args_tmp = "%s CHECKMODE=True" % module_args_tmp
module_return = self.runner._execute_module(conn, tmp, 'file', module_args_tmp, inject=inject, complex_args=complex_args)