From d5ee2840022fcabe764e8f91ecea38a680ca291b Mon Sep 17 00:00:00 2001 From: Kedu SCCL <42957183+keducoop@users.noreply.github.com> Date: Thu, 26 Nov 2020 15:15:23 +0100 Subject: [PATCH 1/2] Update main.yml Removed leading character '%' from line being added to '/etc/sudoers/my_user' file --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 7e48251..eb75701 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,7 +39,7 @@ - name: "Enable passwordless sudo" copy: - content: "%{{ user_name }} ALL=(ALL) NOPASSWD:ALL" + content: "{{ user_name }} ALL=(ALL) NOPASSWD:ALL" dest: "/etc/sudoers.d/{{ user_name }}" owner: "root" group: "root" From d763b9e4efc5482244e313c8076b52ed52d4c67d Mon Sep 17 00:00:00 2001 From: Kedu SCCL <42957183+keducoop@users.noreply.github.com> Date: Thu, 26 Nov 2020 15:31:21 +0100 Subject: [PATCH 2/2] Update main.yml Adding trailing EOL to the line being added to '/etc/sudoers.d/my_user' file to avoid error "/etc/sudoers:28: syntax error, unexpected INCLUDEDIR, expecting END or ':' or '\n'" --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index eb75701..302ae68 100755 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,7 +39,7 @@ - name: "Enable passwordless sudo" copy: - content: "{{ user_name }} ALL=(ALL) NOPASSWD:ALL" + content: "{{ user_name }} ALL=(ALL) NOPASSWD:ALL\n" dest: "/etc/sudoers.d/{{ user_name }}" owner: "root" group: "root"