if else in one liner

This commit is contained in:
2025-11-23 18:21:10 +01:00
parent 613675b29d
commit ad1925f173
+1 -7
View File
@@ -21,13 +21,7 @@
- name: Set NRPE package location - name: Set NRPE package location
set_fact: set_fact:
nrpe_location: > nrpe_location: >
{% if ansible_facts['os_family'] == 'Debian' %} {% 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 %}
/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 register: nrpe_package_location_set
- name: Debug NRPE package info - name: Debug NRPE package info