Created
June 4, 2014 17:44
-
-
Save mlieberman85/77070f8af38a3c493b04 to your computer and use it in GitHub Desktop.
Group intersection question
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
# This works. | |
tasks: | |
- debug: var=hostvars[item] | |
with_items: groups['groupA'] | |
# How can I do something like: | |
tasks: | |
- debug: var=hostvars[item] | |
with_items: groups['groupA'].intersect(groups['groupB']) | |
# the equivalent of below | |
hosts: groupA:&groupB | |
# except inside a task. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment