Debian Codegraph @

test/integration/targets/lookup_template/tasks/trim_blocks.yml

raw
1 # VERIFY trim_blocks
2 - name: Render a template with "trim_blocks" set to False
3 copy:
4 content: "{{ lookup('template', 'trim_blocks.j2', trim_blocks=False) }}"
5 dest: "{{ output_dir }}/trim_blocks_false.templated"
6 register: trim_blocks_false_result
7
8 - name: Get checksum of known good trim_blocks_false.expected
9 stat:
10 path: "{{ role_path }}/files/trim_blocks_false.expected"
11 register: trim_blocks_false_good
12
13 - name: Verify templated trim_blocks_false matches known good using checksum
14 assert:
15 that:
16 - "trim_blocks_false_result.checksum == trim_blocks_false_good.stat.checksum"
17
18 - name: Render a template with "trim_blocks" set to True
19 copy:
20 content: "{{ lookup('template', 'trim_blocks.j2', trim_blocks=True) }}"
21 dest: "{{ output_dir }}/trim_blocks_true.templated"
22 register: trim_blocks_true_result
23
24 - name: Get checksum of known good trim_blocks_true.expected
25 stat:
26 path: "{{ role_path }}/files/trim_blocks_true.expected"
27 register: trim_blocks_true_good
28
29 - name: Verify templated trim_blocks_true matches known good using checksum
30 assert:
31 that:
32 - "trim_blocks_true_result.checksum == trim_blocks_true_good.stat.checksum"