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 exclusive: true
loop: "{{ users }}" loop: "{{ users }}"
- name: Allow passwordless sudo to 'sudo' group - name: Allow passwordless sudo
ansible.builtin.lineinfile: community.general.sudoers:
path: /etc/sudoers name: passwordless
regexp: '^%sudo ALL=' group: sudo
line: '%sudo ALL=(ALL:ALL) NOPASSWD: ALL' host: ALL
validate: /usr/sbin/visudo -cf %s commands: ALL
nopassword: true
state: present state: present