dfg
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 3s
ansible-lint / Ansible Lint (pull_request) Successful in 31s

This commit is contained in:
Michael Grote 2024-10-23 22:17:41 +02:00
parent c315cb0de9
commit 29cf608bdf

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