This commit is contained in:
Hideki Saito 2022-03-13 01:57:12 +09:00
parent 70b843ba43
commit 3a26827e27

View file

@ -23,31 +23,31 @@
debug: debug:
msg: "{{ output_dir }}" msg: "{{ output_dir }}"
- block: #- block:
- name: test that the file was really copied over # - 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: synchronize file to new filename # - name: synchronize file to new filename
synchronize: # synchronize:
src: "{{ output_dir }}/foo.txt" # src: "{{ output_dir }}/foo.txt"
dest: "{{ output_dir }}/foo.result" # dest: "{{ output_dir }}/foo.result"
register: sync_result # register: sync_result
- assert: # - assert:
that: # that:
- '''changed'' in sync_result' # - '''changed'' in sync_result'
- sync_result.changed == true # - sync_result.changed == true
- '''cmd'' in sync_result' # - '''cmd'' in sync_result'
- '''rsync'' in sync_result.cmd' # - '''rsync'' in sync_result.cmd'
- '''msg'' in sync_result' # - '''msg'' in sync_result'
- sync_result.msg.startswith('>f+') # - sync_result.msg.startswith('>f+')
- 'sync_result.msg.endswith(''+ foo.txt # - 'sync_result.msg.endswith(''+ foo.txt
#
'')' # '')'
when: # when:
- ansible_facts.virtualization_type != 'docker' # - ansible_facts.virtualization_type != 'docker'
- block: - block:
- name: test that the file was really copied over - name: test that the file was really copied over