diff --git a/roles/mgrote_users/tasks/main.yml b/roles/mgrote_users/tasks/main.yml index 6cf206cb..c76a21da 100644 --- a/roles/mgrote_users/tasks/main.yml +++ b/roles/mgrote_users/tasks/main.yml @@ -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