Created
February 4, 2017 08:48
-
-
Save gmic/385d7f4a41eee01435c88c29a03502cd to your computer and use it in GitHub Desktop.
Task filter for host group
This file contains 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
- name: Example task only run for hosts in the group vagrant | |
debug: msg="I'm a vagrant box" | |
when: "vagrant" in group_names | |
- name: Example task only run for hosts *not* in the group vagrant | |
debug: msg="I'm not in the vagrant group.. sad panda :(" | |
when: "vagrant" not in group_names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment