This commit is contained in:
Hideki Saito 2022-03-13 01:25:34 +09:00
parent 6dbe55534a
commit 4ed7a677ce

View file

@ -31,21 +31,29 @@
debug: debug:
msg: "{{ output_dir }}" msg: "{{ output_dir }}"
- name: test that the file was really copied over - block:
- name: test that the file was really copied over
stat: stat:
path: "{{ output_dir }}/{{item}}" path: "{{ output_dir }}/{{item}}"
with_items: with_items:
- foo.txt - foo.txt
- bar.txt - bar.txt
- name: copy file to new filename
- name: copy file to new filename
copy: copy:
src: "{{ output_dir }}/foo.txt" src: "{{ output_dir }}/foo.txt"
dest: "{{ output_dir }}/foo.result" dest: "{{ output_dir }}/foo.result"
when: when:
- ansible_facts.virtualization_type != 'docker' - ansible_facts.virtualization_type != 'docker'
- name: copy file to new filename - block:
- name: test that the file was really copied over
stat:
path: "{{ output_dir }}/{{item}}"
with_items:
- foo.txt
- bar.txt
delegate_to: "{{ inventory_hostname }}"
- name: copy file to new filename
copy: copy:
src: "{{ output_dir }}/foo.txt" src: "{{ output_dir }}/foo.txt"
dest: "{{ output_dir }}/foo.result" dest: "{{ output_dir }}/foo.result"