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