switch to using sudoers module

This commit is contained in:
Bertrand Lanson 2023-06-10 22:44:47 +02:00
parent 442f4c71c2
commit e191d1a5d5

View File

@ -18,10 +18,10 @@
create_home: true
- name: "Add user to sudoers"
ansible.builtin.copy:
dest: "/etc/sudoers.d/{{ provision_ansible_user_name }}"
owner: root
group: root
mode: 0640
content: "{{ provision_ansible_user_name }} ALL=(ALL) NOPASSWD: ALL"
community.general.sudoers:
name: "{{ provision_ansible_user_name }}"
user: "{{ provision_ansible_user_name }}"
commands: ALL
nopassword: true
setenv: true
when: provision_ansible_user_sudoer