From 5db4f473756842d174e832cc00657c983ca8c1ee Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 22 Nov 2025 20:42:12 +0100 Subject: [PATCH] when clause as bullit list --- roles/pips/tasks/nagios_tasks.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/pips/tasks/nagios_tasks.yml b/roles/pips/tasks/nagios_tasks.yml index 961f47a..465f0cf 100644 --- a/roles/pips/tasks/nagios_tasks.yml +++ b/roles/pips/tasks/nagios_tasks.yml @@ -35,7 +35,9 @@ state: present become: true register: nrpe_install_result - when: "{{ ansible_facts['os_family'] == 'Debian' and not nrpe_installed }}" + when: + - ansible_facts['os_family'] == 'Debian' + - and not nrpe_installed - name: Ensure NRPE is installed (RedHat/CentOS) yum: @@ -43,7 +45,9 @@ state: present become: yes register: nrpe_install_result - when: "{{ ansible_facts['os_family'] == 'RedHat' and not nrpe_installed }}" + when: + - ansible_facts['os_family'] == 'RedHat' + - not nrpe_installed - name: Ensure NRPE is installed (FreeBSD) ansible.builtin.pkgng: