Debian Codegraph @

test/integration/targets/blockinfile/tasks/block_without_trailing_newline.yml

raw
1 - name: Add block without trailing line separator
2 blockinfile:
3 path: "{{ remote_tmp_dir_test }}/chomped_block_test.txt"
4 create: yes
5 content: |-
6 one
7 two
8 three
9 register: chomptest1
10
11 - name: Add block without trailing line separator again
12 blockinfile:
13 path: "{{ remote_tmp_dir_test }}/chomped_block_test.txt"
14 content: |-
15 one
16 two
17 three
18 register: chomptest2
19
20 - name: Check output file
21 stat:
22 path: "{{ remote_tmp_dir_test }}/chomped_block_test.txt"
23 register: chomptest_file
24
25 - name: Ensure chomptest results are correct
26 assert:
27 that:
28 - chomptest1 is changed
29 - chomptest2 is not changed
30 - chomptest_file.stat.checksum == '50d49f528a5f7147c7029ed6220c326b1ee2c4ae'