summaryrefslogtreecommitdiffstats
path: root/test/playbook-when.yml
blob: 1884cf76f4ef4f507ef3e81d6dc50b41abedf9d0 (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
---
- hosts: all
  connection: local
  gather_facts: False

  vars: 
    internal: "print me"

  tasks: 
  - action: debug msg="skip me"
    when_unset: $internal

  - action: debug msg="$internal"
    when_set: $internal

  - action: debug msg="skip me"
    when_unset: $external

  - action: debug msg="$external"
    when_set: $external

  - action: debug msg="run me"
    when_unset: $this_var_does_not_exist

  - action: debug msg="skip me"
    when_set: $this_var_does_not_exist