From adf404bf258f319582f71133b284e5bf36187237 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Mon, 9 May 2022 11:33:04 +0200 Subject: [PATCH] fix: adapt condition --- tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 77ae886..70853d2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -15,8 +15,8 @@ with_dict: "{{ unix_users }}" loop_control: loop_var: unix_user - when: unix_groups is defined and - unix_groups | length > 0 and + when: unix_users is defined and + unix_users | length > 0 and unix_user.value.state is defined and unix_user.value.state == 'absent' @@ -37,8 +37,8 @@ with_dict: "{{ unix_users }}" loop_control: loop_var: unix_user - when: unix_groups is defined and - unix_groups | length > 0 and + when: unix_users is defined and + unix_users | length > 0 and ( (unix_user.value.state is defined and unix_user.value.state == 'present') or unix_user.value.state is not defined