From e191d1a5d5d10fc081661eafdfcff0c7b420a388 Mon Sep 17 00:00:00 2001 From: Bertrand Lanson Date: Sat, 10 Jun 2023 22:44:47 +0200 Subject: [PATCH] switch to using sudoers module --- tasks/create_user.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/create_user.yml b/tasks/create_user.yml index df6f61f..b40d594 100644 --- a/tasks/create_user.yml +++ b/tasks/create_user.yml @@ -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