Skip to content

Instantly share code, notes, and snippets.

@mikerowehl
Last active August 29, 2015 14:23
Embed
What would you like to do?
Negative pattern in ansible
- hosts: tag_clusterType_*
connection: local
gather_facts: false
tasks:
- name: Get everything in a cluster
debug: var=hostvars[inventory_hostname]['ec2_tag_Name']
- hosts: all:!tag_clusterType_*
connection: local
gather_facts: false
tasks:
- name: Everything else
debug: var=hostvars[inventory_hostname]['ec2_tag_Name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment