mirror of https://github.com/ansible/ansible.git
Merge pull request #2623 from willthames/when_set_bug
Prevent premature variable substitution in taskspull/2667/head
commit
e7f5186dec
@ -0,0 +1,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
|
||||
|
Loading…
Reference in New Issue