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: