From 8a48110c2157af36e9023804b4c9f390d14e5000 Mon Sep 17 00:00:00 2001 From: Hadrien Patte Date: Sat, 23 Mar 2019 19:42:09 +0100 Subject: [PATCH] Feat: add validate for sudoers Signed-off-by: Hadrien Patte --- roles/ldap-client/tasks/1_group_security.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/ldap-client/tasks/1_group_security.yml b/roles/ldap-client/tasks/1_group_security.yml index 607dce7..8477ac4 100644 --- a/roles/ldap-client/tasks/1_group_security.yml +++ b/roles/ldap-client/tasks/1_group_security.yml @@ -23,6 +23,7 @@ regexp: ^%{{ sudo_group }} line: "%{{ sudo_group }} ALL=(ALL:ALL) ALL" state: present + validate: /usr/sbin/visudo -cf %s # Set sudo location group - name: Configure sudoers sudo location group @@ -31,4 +32,5 @@ regexp: ^%{{ sudo_group_location }} line: "%{{ sudo_group_location }} ALL=(ALL:ALL) ALL" state: present + validate: /usr/sbin/visudo -cf %s when: sudo_group_location is defined