This should allow for ansible to build correctly the templates for noc01/noc02.

This commit is contained in:
Stephen Smoogen 2022-11-17 12:06:00 -05:00
parent 1250b004ea
commit e36f982263
3 changed files with 10 additions and 9 deletions

View file

@ -12,9 +12,11 @@ define service {
use criticaltemplate
}
{% if vars['nagios_location'] == 'external' %}
define service {
host_name nagios-external.fedoraproject.org
service_description ICMP-Ping6-check
check_command check-host-alive6!fedorapeople.org!1500.0,20%!2500.0,80%
use criticaltemplate
}
{% endif %}

View file

@ -419,7 +419,6 @@
- rdu-hosts.cfg
- iad2-external.cfg
- aws-hosts.cfg
- ibiblio-hosts-ipv6.cfg
when: env == "production"
tags:
- nagios_server
@ -457,6 +456,7 @@
template: src=nagios/hosts/{{item}}.j2 dest=/etc/nagios/hosts/{{item}} mode=0644 owner=root group=root
with_items:
- iad2-external.cfg
- ibiblio-hosts-ipv6.cfg
when: env == "production" and nagios_location == "external"
tags:
- nagios_server

View file

@ -1,13 +1,12 @@
{% for host in groups['all']|sort %}
{% if hostvars[host].datacenter == 'ibiblio' and hostvars[host].nagios_Can_Connect == true %}
define host {
{% if vars['nagios_location'] == 'iad2_internal' %}
use defaulttemplate
{% else %}
use mincheck
## This template currently only works for noc02. If noc01 gets ipv6 then
## it will need to be revisited.
{% for host in groups['all']|sort %} {%
if hostvars[host].datacenter == 'ibiblio' and
hostvars[host].nagios_Can_Connect == true %} define host { use mincheck
{% endif %}
host_name {{ host }}
host_name {{ host }}-ipv6
{% if hostvars[host].ansible_hostname is defined %}
alias {{ hostvars[host].ansible_hostname }}
{% else %}