From 37c55b9cb2fe5478463c8bd128b3f1a6330b1618 Mon Sep 17 00:00:00 2001 From: Salt Date: Wed, 6 Oct 2021 15:13:55 -0500 Subject: [PATCH] Change templating behavior of certain sections of the Nagios config --- playbooks/tasks/web/nagios-ansible.cfg.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playbooks/tasks/web/nagios-ansible.cfg.j2 b/playbooks/tasks/web/nagios-ansible.cfg.j2 index 587881e..d4f0ee9 100644 --- a/playbooks/tasks/web/nagios-ansible.cfg.j2 +++ b/playbooks/tasks/web/nagios-ansible.cfg.j2 @@ -42,9 +42,9 @@ define hostgroup { alias Ansible-managed Hosts } +{% if nagios_commands is defined %} # Commands # Everything here is defined in nagios_commands -{% if nagios_commands is defined %} {% for command in nagios_commands %} define command { command_name {{ command.name }} @@ -58,9 +58,9 @@ define command { {% endfor %} {% endif %} +{% if nagios_services is defined %} # Services # Everything here is defined in nagios_services -{% if nagios_services is defined %} {% for service in nagios_services %} define service { use ansible-generic-service