Commit 3e9ac332 authored by Dan Thomson's avatar Dan Thomson

[#1] Auto-start nrpe service by default

parent c5a7fce4
Pipeline #2159 failed with stage
in 57 seconds
......@@ -294,3 +294,5 @@ ssl_version: TLSv1+
############# OTHER ROLE-BASED OPTIONS
extra_config_files: []
nrpe_autostart: True
......@@ -22,13 +22,14 @@
loop_control:
loop_var: file
- name: Install custom npre.cfg
- name: Install custom nrpe.cfg
template:
src: templates/etc/nagios/nrpe.cfg
dest: /etc/nagios/nrpe.cfg
owner: root
group: root
mode: 0644
register: nrpe_cfg_file
become: yes
- name: Install extra config files
......@@ -41,5 +42,20 @@
with_items: "{{ extra_config_files }}"
loop_control:
loop_var: config_file
register: nrpe_extra_cfg_file
become: yes
- name: Restart nrpe
service:
name: nrpe
state: restarted
when: (nrpe_cfg_file.changed or nrpe_extra_cfg_file.changed) and nrpe_autostart
become: yes
- name: Ensure nrpe has started
service:
name: nrpe
state: started
when: nrpe_autostart
become: yes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment