2019-02-13 18:49:57 +01:00
|
|
|
---
|
|
|
|
- block:
|
|
|
|
- name: Add the additional service groups
|
|
|
|
group: name={{ item }} state=present
|
|
|
|
with_items:
|
|
|
|
- '{{ service_sudoers_group }}'
|
|
|
|
|
|
|
|
- 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([]) }}'
|
|
|
|
when: item.limited_sudoers_user
|
|
|
|
|
|
|
|
- name: Remove selected users to the limited sudoers group
|
2019-02-14 15:18:05 +01:00
|
|
|
user: name={{ item.login }} groups={{ service_sudoers_group }} append=yes
|
2019-02-13 18:49:57 +01:00
|
|
|
with_items: '{{ users_system_users | default([]) }}'
|
|
|
|
when: not item.limited_sudoers_user
|
|
|
|
|
|
|
|
tags: [ 'services', 'users' ]
|