2020-03-09 10:11:07 +01:00
|
|
|
---
|
|
|
|
- name: Setup test fixture
|
|
|
|
copy:
|
|
|
|
src: fixtures/ansible-xml-beers.xml
|
|
|
|
dest: /tmp/ansible-xml-beers.xml.orig
|
|
|
|
|
|
|
|
- name: Remove spaces from test fixture
|
|
|
|
shell: sed 's/^[ ]*//g' < /tmp/ansible-xml-beers.xml.orig > /tmp/ansible-xml-beers.xml
|
|
|
|
|
|
|
|
- name: Pretty print without modification
|
|
|
|
xml:
|
|
|
|
path: /tmp/ansible-xml-beers.xml
|
|
|
|
pretty_print: yes
|
|
|
|
register: pretty_print_only
|
|
|
|
|
|
|
|
- name: Compare to expected result
|
|
|
|
copy:
|
|
|
|
src: results/test-pretty-print-only.xml
|
|
|
|
dest: /tmp/ansible-xml-beers.xml
|
|
|
|
check_mode: yes
|
|
|
|
diff: yes
|
|
|
|
register: comparison
|
|
|
|
|
|
|
|
- name: Test expected result
|
|
|
|
assert:
|
|
|
|
that:
|
2021-05-22 14:53:10 +02:00
|
|
|
- pretty_print_only is changed
|
|
|
|
- comparison is not changed # identical
|
2020-03-09 10:11:07 +01:00
|
|
|
#command: diff -u {{ role_path }}/results/test-pretty-print-only.xml /tmp/ansible-xml-beers.xml
|