Actually implement device roles in Nagios

This commit is contained in:
Salt 2021-11-07 08:55:05 -06:00
parent f250936fe9
commit c5d39db270

View File

@ -113,12 +113,13 @@ define hostgroup {
{% if host.value.primary_ip %} {% if host.value.primary_ip %}
{% for tag in host.value.tags %} {% for tag in host.value.tags %}
{% if tag.slug == "nagios" %} {% if tag.slug == "nagios" %}
# {{ host }}
define host { define host {
use ansible-linux-server use ansible-linux-server
host_name {{ host.value.name }} host_name {{ host.value.name }}
alias {{ host.value.display }} alias {{ host.value.display }}
address {{ host.value.primary_ip.address.split('/',1)[0] }} 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 %} {% if host.value.config_context.extra_checks is defined %}