Debian Codegraph @

test/integration/targets/file/tasks/diff.yml

raw
1 # file module tests for diff being returned in results
2
3 - name: Initialize the test output dir
4 import_tasks: initialize.yml
5
6 - name: Create an empty file
7 file:
8 state: touch
9 mode: "755"
10 path: "{{ remote_tmp_dir_test }}/foobar.txt"
11 register: temp_file
12
13 - name: Confirm diff was not returned in results
14 assert:
15 that:
16 - temp_file.diff is not defined
17
18 - name: Toggle permissions on said empty file
19 file:
20 state: file
21 mode: "644"
22 path: "{{ temp_file.dest }}"
23 register: temp_file
24 diff: true
25
26 - name: Confirm diff was returned in results
27 assert:
28 that:
29 - temp_file.diff is defined
30
31 - name: Toggle permissions on said empty file...again
32 file:
33 state: file
34 mode: "755"
35 path: "{{ temp_file.path }}"
36 register: temp_file
37 diff: false
38 environment:
39 ANSIBLE_DIFF_ALWAYS: True
40
41 - name: Confirm diff was not returned in results
42 assert:
43 that:
44 - temp_file.diff is not defined