Skip to content

Instantly share code, notes, and snippets.

@michaelgugino
Created September 5, 2018 18:04
Show Gist options
  • Select an option

  • Save michaelgugino/56801b562553b275102c478d09c08726 to your computer and use it in GitHub Desktop.

Select an option

Save michaelgugino/56801b562553b275102c478d09c08726 to your computer and use it in GitHub Desktop.
Groups and such.
#inventory.txt
[apache_hosts]
node1
node2
[new_group]
node2
# playbook1.yml
- hosts: apache_hosts
tasks:
- do_something
# cli
ansible-playbook -i inventory.txt playbook1.yml -l new_group
# Results:
# do_something runs against only node2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment