You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/playbook-when.yml

28 lines
486 B
YAML

---
- 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