Use sudoers module

This commit is contained in:
Sam A. 2023-11-11 16:41:47 +01:00
parent 93c0101ca4
commit cb561805d6
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -17,10 +17,11 @@
exclusive: true
loop: "{{ users }}"
- name: Allow passwordless sudo to 'sudo' group
ansible.builtin.lineinfile:
path: /etc/sudoers
regexp: '^%sudo ALL='
line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL'
validate: /usr/sbin/visudo -cf %s
- name: Allow passwordless sudo
community.general.sudoers:
name: passwordless
group: sudo
host: ALL
commands: ALL
nopassword: true
state: present