Skip to content

Instantly share code, notes, and snippets.

@danrough
Created February 12, 2014 12:29
Show Gist options
  • Save danrough/8954719 to your computer and use it in GitHub Desktop.
Save danrough/8954719 to your computer and use it in GitHub Desktop.
A portion of a template used in one of our ansible playbooks to generate nagios hostgroup definitions file.
define hostgroup {
hostgroup_name web_servers
alias Web servers
members {% for host in groups['web'] %}{{ hostvars[host]['ansible_ssh_host'] }}{% if not loop.last %}, {% endif %}{% endfor %}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment