Feat: add validate for sudoers

Signed-off-by: Hadrien Patte <hadrien.patte@protonmail.com>
This commit is contained in:
Hadrien Patte 2019-03-23 19:42:09 +01:00
parent 737ca7b996
commit 8a48110c21
No known key found for this signature in database
GPG Key ID: 0954F2874A54F4B1
1 changed files with 2 additions and 0 deletions

View File

@ -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