Skip to content

Instantly share code, notes, and snippets.

@gregbuehler
Created October 31, 2013 22:09
Show Gist options
  • Select an option

  • Save gregbuehler/7258036 to your computer and use it in GitHub Desktop.

Select an option

Save gregbuehler/7258036 to your computer and use it in GitHub Desktop.
ansible-playbook -i inventory/production site.yml
[production:children]
webserver
database
[webserver]
www01
www02
www03
[database]
db01
db02
db03
---
- hosts: all
vars_files:
- "./default_vars.yml"
roles:
- { role: monitored }
- { role: apache, when: "'webserver' in group_names" }
- { role: mysql, when: "'database' in group_names" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment