mirror of
https://github.com/pigmonkey/spark.git
synced 2026-07-24 00:20:07 +00:00
Validate sudoers file before copying
Ansible `copy` module has `validation` parameter that allows to validate the file prior to replacing it on remote: > The validation command to run before copying into place. The path to the file to validate is passed in via '%s' which must be present as in the example below. The command is passed securely so shell features like expansion and pipes won't work. Here we use `visudo` to validate the file before writing it in place, so the user won't lock himself out in case of incorrect changes to `sudoers.j2` template.
This commit is contained in:
parent
abe2715fc4
commit
eb1d298446
1 changed files with 1 additions and 1 deletions
|
|
@ -10,6 +10,6 @@
|
|||
- sudo
|
||||
|
||||
- name: Copy sudo configuration
|
||||
template: src=sudoers.j2 dest=/etc/sudoers mode=440
|
||||
template: src=sudoers.j2 dest=/etc/sudoers mode=440 validate='visudo -cf %s'
|
||||
tags:
|
||||
- sudo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue