summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/lookup_template/tasks/trim_blocks.yml
blob: b82fc0067b8b0be6243a740aa746af966c0d4e13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# VERIFY trim_blocks
- name: Render a template with "trim_blocks" set to False
  copy:
    content: "{{ lookup('template', 'trim_blocks.j2', trim_blocks=False) }}"
    dest: "{{ output_dir }}/trim_blocks_false.templated"
  register: trim_blocks_false_result

- name: Get checksum of known good trim_blocks_false.expected
  stat:
    path: "{{ role_path }}/files/trim_blocks_false.expected"
  register: trim_blocks_false_good

- name: Verify templated trim_blocks_false matches known good using checksum
  assert:
    that:
      - "trim_blocks_false_result.checksum == trim_blocks_false_good.stat.checksum"

- name: Render a template with "trim_blocks" set to True
  copy:
    content: "{{ lookup('template', 'trim_blocks.j2', trim_blocks=True) }}"
    dest: "{{ output_dir }}/trim_blocks_true.templated"
  register: trim_blocks_true_result

- name: Get checksum of known good trim_blocks_true.expected
  stat:
    path: "{{ role_path }}/files/trim_blocks_true.expected"
  register: trim_blocks_true_good

- name: Verify templated trim_blocks_true matches known good using checksum
  assert:
    that:
      - "trim_blocks_true_result.checksum == trim_blocks_true_good.stat.checksum"