Debian Codegraph @

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

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