revert parts of "506fa8da8d" (explanation inline) #217

Merged
mg merged 33 commits from dbg into master 2024-10-23 22:55:42 +02:00
Showing only changes of commit 29cf608bdf - Show all commits

View file

@ -53,6 +53,9 @@
block: |
{{ item.username }} ALL=(ALL) {{ 'NOPASSWD:' if (item.allow_passwordless_sudo | d(false)) else '' }}ALL
validate: 'visudo -cf %s'
owner: root
group: root
mode: "0644"
loop: '{{ users }}'
when: item.allow_sudo|default(false) and item.allow_sudo is defined
no_log: true
@ -60,7 +63,7 @@
- name: Ensure users are removed from sudoers # ungetestet
ansible.builtin.file:
path: "/etc/sudoers.d/users-sudo-{{ item.username }}"
state: "{{ item.state | default('present') }}"
state: absent
loop: '{{ users }}'
when: (item.allow_sudo|default(false) and item.allow_sudo is defined) and ("absent" in item.state)
no_log: true