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 %}"