Debian Codegraph @

test/integration/targets/check_mode/check_mode-not-on-cli.yml

raw
1 ---
2 # Run without --check
3 - hosts: testhost
4 gather_facts: False
5 tasks:
6 - command: 'echo ran'
7 register: command_out
8
9 - debug: var=command_out
10 - name: check that this did not run in check mode
11 assert:
12 that:
13 - '"ran" in command_out["stdout"]'
14
15 - hosts: testhost
16 gather_facts: False
17 check_mode: True
18 tasks:
19 - command: 'echo ran'
20 register: command_out
21
22 - name: check that play level check_mode overrode the cli
23 assert:
24 that:
25 - '"check mode" in command_out["msg"]'
26
27 - hosts: testhost
28 gather_facts: False
29 tasks:
30 - command: 'echo ran'
31 register: command_out
32 check_mode: True
33
34 - name: check that task level check_mode overrode the cli
35 assert:
36 that:
37 - '"check mode" in command_out["msg"]'