From 84205634a110676b5651ebd44d81f185474d6d61 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 19 Apr 2024 15:24:59 +0200 Subject: [PATCH] Fix the users existence conditional. --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index d791512..5c0d2c6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -69,7 +69,7 @@ loop: '{{ users_system_users }}' when: - item.ssh_key is defined - - item.state is not defined or item.state != "present" + - item.state is not defined or item.state == "present" - name: Add the admin users to the sudoers group ansible.builtin.user: @@ -79,7 +79,7 @@ loop: '{{ users_system_users }}' when: - item.admin is defined and item.admin - - item.state is not defined or item.state != "present" + - item.state is not defined or item.state == "present" - name: Manage additional users tags: users