Skip to content

Commit

Permalink
removed if in our constants.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
xFuture603 committed Jan 11, 2022
1 parent 149b4e3 commit 0c61e77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
29 changes: 15 additions & 14 deletions roles/icinga_agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
icinga_agent_package: icinga2
icinga_agent_registration: false
icinga_agent_ca_host_icinga_port: 5665
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_constants:
RedHat: |
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 = ""
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
Expand Down
6 changes: 1 addition & 5 deletions roles/icinga_agent/templates/configuration/constants.conf.j2
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# {{ ansible_managed }}

{% if ansible_os_family == 'RedHat' %}
{{ icinga_agent_constants_conf_rhel }}
{% elif ansible_os_family == 'Debian' %}
{{ icinga_agent_constants_conf_debian }}
{% endif %}"
{{ icinga_agent_constants[ansible_os_family] }}

0 comments on commit 0c61e77

Please sign in to comment.