1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fix an issue that copying directory will fail when trying to change file attributes and the target file already exists on remote

- the issue was introduced by the commit 84759faa09
This commit is contained in:
someda 2014-07-24 14:03:36 +09:00
parent a21092d7c2
commit 1b1d5d0d3d
2 changed files with 8 additions and 1 deletions

View file

@ -268,6 +268,7 @@ class ActionModule(object):
new_module_args = dict( new_module_args = dict(
src=tmp_src, src=tmp_src,
dest=dest, dest=dest,
original_basename=source_rel
) )
if self.runner.noop_on_check(inject): if self.runner.noop_on_check(inject):
new_module_args['CHECKMODE'] = True new_module_args['CHECKMODE'] = True

View file

@ -151,5 +151,11 @@
# ignore_errors: True # ignore_errors: True
# register: failed_copy # register: failed_copy
- name: copy already copied directory again
copy: src=subdir dest={{output_subdir | expanduser}} owner={{ansible_ssh_user}}
register: copy_result5
- name: assert that the directory was not changed
assert:
that:
- "not copy_result5|changed"