Skip to content

Commit

Permalink
Merge pull request #14 from T-Systems-MMS/add_debian_compatibility
Browse files Browse the repository at this point in the history
fix handler name and add the correct path for constants.conf on Debian based installations
  • Loading branch information
xFuture603 authored Jan 11, 2022
2 parents f0fcd62 + 0c61e77 commit 0acd831
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
22 changes: 15 additions & 7 deletions roles/icinga_agent/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
icinga_agent_package: icinga2
icinga_agent_registration: false
icinga_agent_ca_host_icinga_port: 5665
icinga_agent_constants_conf: |
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:
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
2 changes: 1 addition & 1 deletion roles/icinga_agent/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: restart icinga2-agent
- name: start icinga2-agent
ansible.builtin.service:
name: icinga2
enabled: true
Expand Down
8 changes: 4 additions & 4 deletions roles/icinga_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
with_fileglob:
- "../templates/configuration/*"
notify:
- restart icinga2-agent
- start icinga2-agent

- name: copy icinga feature files
ansible.builtin.template:
Expand All @@ -48,7 +48,7 @@
with_fileglob:
- "../templates/features/*"
notify:
- restart icinga2-agent
- start icinga2-agent

- name: copy custom icinga feature files
ansible.builtin.template:
Expand All @@ -60,7 +60,7 @@
with_fileglob:
- "{{ icinga_agent_custom_features_template_path }}"
notify:
- restart icinga2-agent
- start icinga2-agent
when:
- icinga_agent_custom_features_template_path is defined
- icinga_agent_custom_features_template_path | length > 0
Expand Down Expand Up @@ -112,7 +112,7 @@
args:
creates: "/var/lib/icinga2/certs/ca.crt"
notify:
- restart icinga2-agent
- start icinga2-agent
when:
- icinga_agent_registration | bool
- icinga_agent_salt is defined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# {{ ansible_managed }}

{{ icinga_agent_constants_conf }}
{{ icinga_agent_constants[ansible_os_family] }}

0 comments on commit 0acd831

Please sign in to comment.