|
|
@ -162,6 +162,50 @@
|
|
|
|
that:
|
|
|
|
that:
|
|
|
|
- not recursive_copy_result_again|changed
|
|
|
|
- not recursive_copy_result_again|changed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Recursive folder copy with trailing slash (see issue 23559)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: make an output subdirectory
|
|
|
|
|
|
|
|
win_file:
|
|
|
|
|
|
|
|
path: "{{win_output_dir}}\\subtrailing\\"
|
|
|
|
|
|
|
|
state: directory
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: test recursive copy to directory
|
|
|
|
|
|
|
|
win_copy:
|
|
|
|
|
|
|
|
src: subdir/
|
|
|
|
|
|
|
|
dest: "{{win_output_dir}}\\subtrailing\\"
|
|
|
|
|
|
|
|
register: recursive_copy_result2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: get stats on files within sub directory
|
|
|
|
|
|
|
|
win_find:
|
|
|
|
|
|
|
|
paths: "{{win_output_dir}}\\subtrailing\\"
|
|
|
|
|
|
|
|
recurse: True
|
|
|
|
|
|
|
|
register: recurse_find_results2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: assert recursive copy worked
|
|
|
|
|
|
|
|
assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- recursive_copy_result2|changed
|
|
|
|
|
|
|
|
- recurse_find_results2.examined == 6 # checks that it found 3 folders and 3 files.
|
|
|
|
|
|
|
|
# Note this is different from the test above because, by including the trailing
|
|
|
|
|
|
|
|
# slash on the source, we only get the *contents* of the source folder
|
|
|
|
|
|
|
|
# without the trailing slash, we would get the source folder *and* its
|
|
|
|
|
|
|
|
# contents.
|
|
|
|
|
|
|
|
# See 'src' parameter documentation
|
|
|
|
|
|
|
|
# here: http://docs.ansible.com/ansible/win_copy_module.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: test recursive copy to directory again with source slash
|
|
|
|
|
|
|
|
win_copy:
|
|
|
|
|
|
|
|
src: subdir/
|
|
|
|
|
|
|
|
dest: "{{win_output_dir}}\\subtrailing\\"
|
|
|
|
|
|
|
|
register: recursive_copy_result_again2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: assert recursive copy worked
|
|
|
|
|
|
|
|
assert:
|
|
|
|
|
|
|
|
that:
|
|
|
|
|
|
|
|
- not recursive_copy_result_again2|changed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# test 'content' parameter
|
|
|
|
- name: create file with content
|
|
|
|
- name: create file with content
|
|
|
|
win_copy:
|
|
|
|
win_copy:
|
|
|
|
content: abc
|
|
|
|
content: abc
|
|
|
|