Skip to content

Instantly share code, notes, and snippets.

@gkspranger
Last active April 12, 2017 13:22
Show Gist options
  • Save gkspranger/00ccec68a5e3084ea3ab6304d2699c21 to your computer and use it in GitHub Desktop.
Save gkspranger/00ccec68a5e3084ea3ab6304d2699c21 to your computer and use it in GitHub Desktop.
---
# just a simple example of me using my bootstrap.yml file and re-using an action role
# this is nice because: 1) i can put my roles where i want to, and 2) it allows me to be as DRY as i want to be
- hosts: localhost
connection: local
gather_facts: False
become: False
vars_files:
# again, this defines my roles_dir and playbooks_dir
- "{{ inventory_dir }}/vars/bootstrap.yml"
- "{{ inventory_dir }}/vars/vault.yml"
roles:
# yay !! a re-usable action role, i just pass it a var
- role: "{{ roles_dir }}/action/nagios_silence_unsilence"
nagios_action: silence
# where the meat happens
- role: "{{ roles_dir }}/action/restart_awhsumapp"
# re-using that action role again
- role: "{{ roles_dir }}/action/nagios_silence_unsilence"
nagios_action: unsilence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment