install package nrpe
This commit is contained in:
@@ -5,13 +5,15 @@
|
|||||||
- name: Check if nagios NRPE is installed
|
- name: Check if nagios NRPE is installed
|
||||||
debug:
|
debug:
|
||||||
msg: "NRPE is installed."
|
msg: "NRPE is installed."
|
||||||
when: "'nagios-nrpe' in ansible_facts.packages"
|
when: "'nrpe' in ansible_facts.packages"
|
||||||
|
|
||||||
- name: Ensure NRPE is installed (Debian/Ubuntu)
|
- name: Ensure NRPE is installed (Debian/Ubuntu)
|
||||||
apt:
|
apt:
|
||||||
name: nrpe
|
name: nrpe
|
||||||
state: present
|
state: present
|
||||||
become: yes
|
become: yes
|
||||||
|
register: nrpe_install_result
|
||||||
|
when: "'nrpe' not in ansible_facts.packages"
|
||||||
|
|
||||||
|
|
||||||
- name: Deploy custom Nagios/NRPE script
|
- name: Deploy custom Nagios/NRPE script
|
||||||
@@ -19,3 +21,4 @@
|
|||||||
src: memory_usage_check.py
|
src: memory_usage_check.py
|
||||||
dest: /usr/local/nagios/libexec/my_custom_check.py
|
dest: /usr/local/nagios/libexec/my_custom_check.py
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
when: nrpe_install_result is defined and nrpe_install_result.changed
|
||||||
Reference in New Issue
Block a user