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 use criticaltemplate
} }
{% if vars['nagios_location'] == 'external' %}
define service { define service {
host_name nagios-external.fedoraproject.org host_name nagios-external.fedoraproject.org
service_description ICMP-Ping6-check service_description ICMP-Ping6-check
check_command check-host-alive6!fedorapeople.org!1500.0,20%!2500.0,80% check_command check-host-alive6!fedorapeople.org!1500.0,20%!2500.0,80%
use criticaltemplate use criticaltemplate
} }
{% endif %}

View file

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

View file

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