1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

file tests: control & managed host can be distinct

This commit is contained in:
Pierre-Louis Bonicoli 2017-12-16 17:52:57 +01:00 committed by Matt Clay
parent cbb238522b
commit 32ba02b626

View file

@ -18,6 +18,13 @@
- set_fact: output_file={{output_dir}}/foo.txt
# same as expanduser & expandvars called on managed host
- command: 'echo {{ output_file }}'
register: echo
- set_fact:
remote_file_expanded: '{{ echo.stdout }}'
- name: prep with a basic copy
copy: src=foo.txt dest={{output_file}}
@ -121,8 +128,8 @@
assert:
that:
- "file5a_result.changed == true"
- "file5a_result.diff.before.src == output_file|expanduser"
- "file5a_result.diff.after.src == output_file|basename"
- "file5a_result.diff.before.src == remote_file_expanded"
- "file5a_result.diff.after.src == remote_file_expanded|basename"
- name: soft link idempotency check
file: src={{output_file|basename}} dest={{output_dir}}/soft.txt state=link