mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 23:25:28 +01:00
TEST
This commit is contained in:
parent
f976c994c7
commit
70b843ba43
1 changed files with 30 additions and 8 deletions
|
|
@ -30,12 +30,24 @@
|
|||
with_items:
|
||||
- foo.txt
|
||||
- bar.txt
|
||||
- name: copy file to new filename
|
||||
copy:
|
||||
- name: synchronize file to new filename
|
||||
synchronize:
|
||||
src: "{{ output_dir }}/foo.txt"
|
||||
dest: "{{ output_dir }}/foo.result"
|
||||
when:
|
||||
- ansible_facts.virtualization_type != 'docker'
|
||||
register: sync_result
|
||||
- assert:
|
||||
that:
|
||||
- '''changed'' in sync_result'
|
||||
- sync_result.changed == true
|
||||
- '''cmd'' in sync_result'
|
||||
- '''rsync'' in sync_result.cmd'
|
||||
- '''msg'' in sync_result'
|
||||
- sync_result.msg.startswith('>f+')
|
||||
- 'sync_result.msg.endswith(''+ foo.txt
|
||||
|
||||
'')'
|
||||
when:
|
||||
- ansible_facts.virtualization_type != 'docker'
|
||||
|
||||
- block:
|
||||
- name: test that the file was really copied over
|
||||
|
|
@ -45,13 +57,23 @@
|
|||
- foo.txt
|
||||
- bar.txt
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
delegate_facts: true
|
||||
- name: copy file to new filename
|
||||
copy:
|
||||
- name: synchronize file to new filename
|
||||
synchronize:
|
||||
src: "{{ output_dir }}/foo.txt"
|
||||
dest: "{{ output_dir }}/foo.result"
|
||||
register: sync_result
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
delegate_facts: true
|
||||
- assert:
|
||||
that:
|
||||
- '''changed'' in sync_result'
|
||||
- sync_result.changed == true
|
||||
- '''cmd'' in sync_result'
|
||||
- '''rsync'' in sync_result.cmd'
|
||||
- '''msg'' in sync_result'
|
||||
- sync_result.msg.startswith('>f+')
|
||||
- 'sync_result.msg.endswith(''+ foo.txt
|
||||
|
||||
'')'
|
||||
when:
|
||||
- ansible_facts.virtualization_type == 'docker'
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue