use ternary condition (more readable)

This commit is contained in:
Jérémy Lecour 2023-11-20 19:03:39 +01:00 committed by Jérémy Lecour
parent 83c178f244
commit 00fad357b5
Signed by: jlecour
SSH key fingerprint: SHA256:h+5LgHRKwN9lS0SsdVR5yZPeFlJE4Mt+8UtL4CcP8dY

View file

@ -2,9 +2,8 @@
- name:
ansible.builtin.set_fact:
nagios_nrpe_processes: "{{ nagios_nrpe_processes_default_before_debian_12 if ansible_distribution_major_version is version('12', '<') else nagios_nrpe_processes_default }}"
when:
nagios_nrpe_processes == None or nagios_nrpe_processes|length <= 0
nagios_nrpe_processes: "{{ ansible_distribution_major_version is version('12', '<') | ternary(nagios_nrpe_processes_default_before_debian_12, nagios_nrpe_processes_default) }}"
when: nagios_nrpe_processes == None or nagios_nrpe_processes | length <= 0
- name: base nrpe & plugins packages are installed
ansible.builtin.apt: