From c5d39db2702f757b6ee570bdbf70daaaa10a10fb Mon Sep 17 00:00:00 2001 From: Salt Date: Sun, 7 Nov 2021 08:55:05 -0600 Subject: [PATCH] Actually implement device roles in Nagios --- playbooks/tasks/web/nagios-ansible.cfg.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/playbooks/tasks/web/nagios-ansible.cfg.j2 b/playbooks/tasks/web/nagios-ansible.cfg.j2 index 7c5e9aa..3579f6f 100644 --- a/playbooks/tasks/web/nagios-ansible.cfg.j2 +++ b/playbooks/tasks/web/nagios-ansible.cfg.j2 @@ -113,12 +113,13 @@ define hostgroup { {% if host.value.primary_ip %} {% for tag in host.value.tags %} {% if tag.slug == "nagios" %} +# {{ host }} define host { use ansible-linux-server host_name {{ host.value.name }} alias {{ host.value.display }} address {{ host.value.primary_ip.address.split('/',1)[0] }} - hostgroups ansible{% for tag in host.value.tags %},tag-{{ tag.slug }}{% endfor %} + hostgroups ansible{% for tag in host.value.tags %},tag-{{ tag.slug }}{% endfor %}{% if host.value.device_role is defined -%},role-{{ host.value.device_role.slug }}{% endif %}{% if host.value.role is defined %},role-{{ host.value.role.slug }}{% endif %} } {% if host.value.config_context.extra_checks is defined %}