Fix a conditional.

This commit is contained in:
Andrea Dell'Amico 2019-04-10 13:13:43 +02:00
parent bc000807bc
commit cb72f67f73
1 changed files with 11 additions and 3 deletions

View File

@ -3,7 +3,11 @@
- name: Add the additional service groups
group: name={{ item }} state=present
with_items: '{{ service_sudoers_group }}'
when: users_system_users is defined
tags: [ 'services', 'users' ]
- block:
- name: Add selected users to the limited sudoers group
user: name={{ item.login }} groups={{ service_sudoers_group }} append=yes
with_items: '{{ users_system_users | default([]) }}'
@ -14,7 +18,9 @@
with_items: '{{ users_system_users | default([]) }}'
when: not item.limited_sudoers_user
when: users_system_users is defined
when:
- users_system_users is defined
- item.limited_sudoers_user is defined
tags: [ 'services', 'users' ]
- block:
@ -28,5 +34,7 @@
with_items: '{{ users_system_users_adjunct }}'
when: not item.limited_sudoers_user
when: users_system_users_adjunct is defined
when:
- users_system_users_adjunct is defined
- item.limited_sudoers_user is defined
tags: [ 'services', 'users' ]