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:18:34 +02:00
parent 29cf608bdf
commit 673f341bcb

View file

@ -45,7 +45,7 @@
# mit Meldung:
# TASK [geerlingguy.postgresql : Ensure PostgreSQL Python libraries are installed.]
# fatal: [forgejo.mgrote.net]: FAILED! => {"msg": "Missing sudo password"}
- name: Ensure users are added to sudoers
- name: Ensure users are added or removed to/from sudoers
ansible.builtin.blockinfile:
create: true
path: "/etc/sudoers.d/users-sudo-{{ item.username }}"
@ -59,11 +59,3 @@
loop: '{{ users }}'
when: item.allow_sudo|default(false) and item.allow_sudo is defined
no_log: true
- name: Ensure users are removed from sudoers # ungetestet
ansible.builtin.file:
path: "/etc/sudoers.d/users-sudo-{{ item.username }}"
state: absent
loop: '{{ users }}'
when: (item.allow_sudo|default(false) and item.allow_sudo is defined) and ("absent" in item.state)
no_log: true