From 149b4e35cda8c61db9b20528557050230c2695bf Mon Sep 17 00:00:00 2001 From: xFuture603 Date: Mon, 10 Jan 2022 16:11:48 +0100 Subject: [PATCH] added fix for wrong path in Debian Installation --- roles/icinga_agent/defaults/main.yml | 9 ++++++++- .../templates/configuration/constants.conf.j2 | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/icinga_agent/defaults/main.yml b/roles/icinga_agent/defaults/main.yml index 166a318..cd66eb3 100644 --- a/roles/icinga_agent/defaults/main.yml +++ b/roles/icinga_agent/defaults/main.yml @@ -2,13 +2,20 @@ icinga_agent_package: icinga2 icinga_agent_registration: false icinga_agent_ca_host_icinga_port: 5665 -icinga_agent_constants_conf: | +icinga_agent_constants_conf_rhel: | const PluginDir = "/usr/lib64/nagios/plugins" const PluginContribDir = "/usr/lib64/nagios/plugins" const ManubulonPluginDir = "/usr/lib64/nagios/plugins" const ZoneName = "{{ ansible_hostname }}" const NodeName = "{{ ansible_hostname }}" const TicketSalt = "" +icinga_agent_constants_conf_debian: | + const PluginDir = "/usr/lib/nagios/plugins" + const PluginContribDir = "/usr/lib/nagios/plugins" + const ManubulonPluginDir = "/usr/lib/nagios/plugins" + const ZoneName = "{{ ansible_hostname }}" + const NodeName = "{{ ansible_hostname }}" + const TicketSalt = "" icinga_agent_api_conf: | accept_config = true accept_commands = true diff --git a/roles/icinga_agent/templates/configuration/constants.conf.j2 b/roles/icinga_agent/templates/configuration/constants.conf.j2 index 5cacfce..57c4bb2 100644 --- a/roles/icinga_agent/templates/configuration/constants.conf.j2 +++ b/roles/icinga_agent/templates/configuration/constants.conf.j2 @@ -1,3 +1,7 @@ # {{ ansible_managed }} -{{ icinga_agent_constants_conf }} +{% if ansible_os_family == 'RedHat' %} + {{ icinga_agent_constants_conf_rhel }} +{% elif ansible_os_family == 'Debian' %} + {{ icinga_agent_constants_conf_debian }} +{% endif %}"