From 71104286465c6cf5474a3451517f61922689b2c4 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Wed, 20 Mar 2024 16:23:39 +0100 Subject: [PATCH] Fix the assignment to the common group. --- tasks/common-users-data-dirs.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tasks/common-users-data-dirs.yml b/tasks/common-users-data-dirs.yml index cdfa114..96b8d13 100644 --- a/tasks/common-users-data-dirs.yml +++ b/tasks/common-users-data-dirs.yml @@ -7,19 +7,23 @@ tags: [ 'users', 'users_acl' ] - block: - - name: Add selected users to the commong group + - name: Add selected users to the common group user: name={{ item.login }} groups={{ common_users_group }} append=yes with_items: '{{ users_system_users }}' - when: users_system_users is defined + when: + - users_system_users is defined + - item.state is not defined or item.state != "present" tags: [ 'users', 'users_acl' ] - block: - - name: Add additional users to the commong group + - name: Add additional users to the common group user: name={{ item.login }} groups={{ common_users_group }} append=yes with_items: '{{ users_system_users_adjunct }}' - when: users_system_users_adjunct is defined + when: + - users_system_users is defined + - item.state is not defined or item.state != "present" tags: [ 'users', 'users_acl' ] - block: