mirror of
https://github.com/luzifer-ansible/users.git
synced 2024-12-23 02:11:17 +00:00
Add ability for sudo access
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
320345868d
commit
776fd91ffb
1 changed files with 17 additions and 0 deletions
|
@ -39,3 +39,20 @@
|
||||||
group: '{{ item.name }}'
|
group: '{{ item.name }}'
|
||||||
when: item.github_key_user is defined and item.ssh_key is not defined
|
when: item.github_key_user is defined and item.ssh_key is not defined
|
||||||
with_items: '{{ users }}'
|
with_items: '{{ users }}'
|
||||||
|
|
||||||
|
- name: Set up sudo access for user
|
||||||
|
copy:
|
||||||
|
content: |
|
||||||
|
{{ item.name }} ALL=(ALL) NOPASSWD: ALL
|
||||||
|
dest: '/etc/sudoers.d/{{ item.name }}'
|
||||||
|
when: item.sudo is defined and item.sudo
|
||||||
|
with_items: '{{ users }}'
|
||||||
|
|
||||||
|
- name: Revoke sudo access for user
|
||||||
|
file:
|
||||||
|
dest: '/etc/sudoers.d/{{ item.name }}'
|
||||||
|
state: absent
|
||||||
|
when: item.sudo is not defined or not item.sudo
|
||||||
|
with_items: '{{ users }}'
|
||||||
|
|
||||||
|
...
|
||||||
|
|
Loading…
Reference in a new issue