mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-23 12:33:59 -07:00
Fixes for mode=preserve (#39343)
* Fixes for mode=preserve * Document mode=preserve for template and copy * Make mode=preserve work with remote_src for copy * Make mode=preserve work for template * Integration tests for copy & template mode=preserve Fixes #39279 * Changed mode option in win_copy to hidden option as it doesn't reflect copy mode
This commit is contained in:
parent
33f358383a
commit
83c1cba511
9 changed files with 104 additions and 11 deletions
|
@ -406,6 +406,27 @@
|
|||
- "stat_results.stat.checksum == ('foo.txt\n'|hash('sha1'))"
|
||||
- "stat_results.stat.mode == '0547'"
|
||||
|
||||
- name: Test copy with mode=preserve and remote_src=True
|
||||
copy:
|
||||
src: '{{ remote_dir }}/copy-foo.txt'
|
||||
dest: '{{ remote_dir }}/copy-foo2.txt'
|
||||
mode: 'preserve'
|
||||
remote_src: True
|
||||
register: copy_results2
|
||||
|
||||
- name: Check the stat results of the file
|
||||
stat:
|
||||
path: '{{ remote_dir }}/copy-foo2.txt'
|
||||
register: stat_results2
|
||||
|
||||
- name: Assert that the file has changed and has correct mode
|
||||
assert:
|
||||
that:
|
||||
- "copy_results2 is changed"
|
||||
- "copy_results2.mode == '0547'"
|
||||
- "stat_results2.stat.checksum == ('foo.txt\n'|hash('sha1'))"
|
||||
- "stat_results2.stat.mode == '0547'"
|
||||
|
||||
#
|
||||
# test recursive copy local_follow=False, no trailing slash
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue