From a9ae1b57d418ce2d2c364e2f3ee087730f21bdc9 Mon Sep 17 00:00:00 2001 From: Jeremy Dubois Date: Tue, 13 Oct 2020 12:01:18 +0200 Subject: [PATCH] Do not use litteral tab in configuration Use "\t" instead of a litteral tab which can easily be broken. Also add a deletion of line with spaces. --- roles/base/tasks/sudo.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/roles/base/tasks/sudo.yml b/roles/base/tasks/sudo.yml index b3fce09..1d71391 100644 --- a/roles/base/tasks/sudo.yml +++ b/roles/base/tasks/sudo.yml @@ -8,17 +8,26 @@ tags: - sudo -# dont't break the tab! - name: Allow wheel group to run command as root in sudo lineinfile: dest: /etc/sudoers insertafter: '# and set environment variables.' - line: '%wheel ALL=(ALL) SETENV: ALL' + line: "%wheel\tALL=(ALL) SETENV: ALL" validate: 'visudo -cf %s' backup: false tags: - sudo +- name: Delete line with space instead of tab + lineinfile: + dest: /etc/sudoers + line: "%wheel ALL=(ALL) SETENV: ALL" + validate: 'visudo -cf %s' + backup: false + state: absent + tags: + - sudo + - name: Configure sudoers for evomaintenance and monitoring blockinfile: state: present