Skip to content

Instantly share code, notes, and snippets.

@mlieberman85
Created June 4, 2014 17:44
Show Gist options
  • Save mlieberman85/77070f8af38a3c493b04 to your computer and use it in GitHub Desktop.
Save mlieberman85/77070f8af38a3c493b04 to your computer and use it in GitHub Desktop.
Group intersection question
# 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