mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2026-11-06 08:48:48 +01:00
This depended on the now-deprecated `groupmems` command:
TASK [sudo : Remove all users from wheel group]
[ERROR]: Task failed: Module failed: Error executing command: [Errno 2] No such file or directory: b'groupmems'
Origin: /home/chris/Documents/shared_projects/arch-infrastructure/roles/sudo/tasks/main.yml:5:3
3
4 # https://github.com/ansible/ansible/issues/11024
5 - name: Remove all users from wheel group
^ column 3
fatal: [build.archlinux.org]: FAILED! => {
"changed": false,
"changed_when_result": false,
"cmd": "groupmems -g wheel --purge",
"rc": 2
}
MSG:
Error executing command.
Link: https://github.com/shadow-maint/shadow/issues/1343
Signed-off-by: Christian Heusel <christian@heusel.eu>
26 lines
677 B
YAML
26 lines
677 B
YAML
- name: Install sudo
|
|
pacman: name=sudo state=present
|
|
|
|
- name: Remove all users from wheel group
|
|
ansible.builtin.group: name=wheel state=absent force=true
|
|
|
|
- name: Re-create the wheel group
|
|
ansible.builtin.group: name=wheel state=present
|
|
|
|
- name: Add sudo users to wheel
|
|
user: name="{{ item }}" append=yes groups=wheel
|
|
loop: "{{ sudo_users }}"
|
|
tags: ['archusers']
|
|
|
|
- name: Allow wheel group to use sudo
|
|
lineinfile:
|
|
dest: /etc/sudoers
|
|
state: present
|
|
regexp: '^%wheel ALL=\(ALL:ALL\) ALL'
|
|
insertafter: '^# %wheel ALL=\(ALL:ALL\) ALL'
|
|
line: '%wheel ALL=(ALL:ALL) ALL'
|
|
validate: 'visudo -cf %s'
|
|
mode: '0440'
|
|
owner: root
|
|
group: root
|