Skip to content

Commit 0acd831

Browse files
authored
Merge pull request #14 from T-Systems-MMS/add_debian_compatibility
fix handler name and add the correct path for constants.conf on Debian based installations
2 parents f0fcd62 + 0c61e77 commit 0acd831

4 files changed

Lines changed: 21 additions & 13 deletions

File tree

roles/icinga_agent/defaults/main.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
icinga_agent_package: icinga2
33
icinga_agent_registration: false
44
icinga_agent_ca_host_icinga_port: 5665
5-
icinga_agent_constants_conf: |
6-
const PluginDir = "/usr/lib64/nagios/plugins"
7-
const PluginContribDir = "/usr/lib64/nagios/plugins"
8-
const ManubulonPluginDir = "/usr/lib64/nagios/plugins"
9-
const ZoneName = "{{ ansible_hostname }}"
10-
const NodeName = "{{ ansible_hostname }}"
11-
const TicketSalt = ""
5+
icinga_agent_constants:
6+
RedHat: |
7+
const PluginDir = "/usr/lib64/nagios/plugins"
8+
const PluginContribDir = "/usr/lib64/nagios/plugins"
9+
const ManubulonPluginDir = "/usr/lib64/nagios/plugins"
10+
const ZoneName = "{{ ansible_hostname }}"
11+
const NodeName = "{{ ansible_hostname }}"
12+
const TicketSalt = ""
13+
Debian: |
14+
const PluginDir = "/usr/lib/nagios/plugins"
15+
const PluginContribDir = "/usr/lib/nagios/plugins"
16+
const ManubulonPluginDir = "/usr/lib/nagios/plugins"
17+
const ZoneName = "{{ ansible_hostname }}"
18+
const NodeName = "{{ ansible_hostname }}"
19+
const TicketSalt = ""
1220
icinga_agent_api_conf: |
1321
accept_config = true
1422
accept_commands = true

roles/icinga_agent/handlers/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: restart icinga2-agent
2+
- name: start icinga2-agent
33
ansible.builtin.service:
44
name: icinga2
55
enabled: true

roles/icinga_agent/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
with_fileglob:
3737
- "../templates/configuration/*"
3838
notify:
39-
- restart icinga2-agent
39+
- start icinga2-agent
4040

4141
- name: copy icinga feature files
4242
ansible.builtin.template:
@@ -48,7 +48,7 @@
4848
with_fileglob:
4949
- "../templates/features/*"
5050
notify:
51-
- restart icinga2-agent
51+
- start icinga2-agent
5252

5353
- name: copy custom icinga feature files
5454
ansible.builtin.template:
@@ -60,7 +60,7 @@
6060
with_fileglob:
6161
- "{{ icinga_agent_custom_features_template_path }}"
6262
notify:
63-
- restart icinga2-agent
63+
- start icinga2-agent
6464
when:
6565
- icinga_agent_custom_features_template_path is defined
6666
- icinga_agent_custom_features_template_path | length > 0
@@ -112,7 +112,7 @@
112112
args:
113113
creates: "/var/lib/icinga2/certs/ca.crt"
114114
notify:
115-
- restart icinga2-agent
115+
- start icinga2-agent
116116
when:
117117
- icinga_agent_registration | bool
118118
- icinga_agent_salt is defined
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# {{ ansible_managed }}
22

3-
{{ icinga_agent_constants_conf }}
3+
{{ icinga_agent_constants[ansible_os_family] }}

0 commit comments

Comments
 (0)