Last active
August 29, 2015 14:14
-
-
Save tgerla/09859fef4050bef6f071 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
connection: local | |
vars: | |
fake_group_names: | |
- web | |
- db | |
tasks: | |
- debug: msg="should match" | |
when: '"web" in fake_group_names or "foo" in fake_group_names' | |
- debug: msg="should not match" | |
when: '"foo" in fake_group_names or "bar" in fake_group_names' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Timothys-MacBook-Pro:ansible-test tgerla$ ansible-playbook -i localhost, test-in.yml | |
PLAY [localhost] ************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [localhost] | |
TASK: [debug msg="should match"] ********************************************** | |
ok: [localhost] => { | |
"msg": "should match" | |
} | |
TASK: [debug msg="should not match"] ****************************************** | |
skipping: [localhost] | |
PLAY RECAP ******************************************************************** | |
localhost : ok=2 changed=0 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment