package location set

This commit is contained in:
2025-11-23 16:15:22 +01:00
parent c360faf1aa
commit c57defd0a8
+13 -1
View File
@@ -18,6 +18,18 @@
{% endif %} {% endif %}
register: nrpe_package_set register: nrpe_package_set
- name: Set NRPE package location
set_fact:
nrpe_location: >
{% if ansible_facts['os_family'] == 'Debian' %}
"/usr/lib/nagios/plugins"
{% elif ansible_facts['os_family'] == 'RedHat' %}
"/usr/local/nagios/libexec"
{% else %}
"/usr/local/libexec/nagios"
{% endif %}
register: nrpe_package_location_set
- name: Set NRPE package name - name: Set NRPE package name
set_fact: set_fact:
@@ -103,7 +115,7 @@
- name: Deploy custom Nagios/NRPE script - name: Deploy custom Nagios/NRPE script
ansible.builtin.copy: ansible.builtin.copy:
src: memory_usage.py src: memory_usage.py
dest: /usr/local/nagios/libexec/my_custom_check.py dest: "{{ nrpe_location }}/my_custom_check.py"
mode: '0755' mode: '0755'
when: when:
- nrpe_installed is defined - nrpe_installed is defined