1
0
Fork 0
mirror of synced 2024-07-24 13:10:22 -04:00

feat: implement option to purge included files directory

This commit is contained in:
Eric Veiras Galisson 2020-08-24 17:58:35 +02:00
parent 153ac6ea48
commit c5acbc696a
3 changed files with 10 additions and 0 deletions

View file

@ -4,6 +4,8 @@
sudoers:
# By default the main sudoers file is managed by this formula (False to skip)
manage_main_config: true
# By default the included directory is not purged from unwanted files
purge_includedir: false
users:
johndoe:
- 'ALL=(ALL) ALL'

View file

@ -4,6 +4,7 @@
sudoers:
pkg: sudo
manage_main_config: true
purge_includedir: false
configpath: /etc
group: root
execprefix: /usr/sbin

View file

@ -9,6 +9,13 @@
include:
- sudoers
{{ sudoers.includedir }}:
file.directory:
- user: root
- group: {{ sudoers.group }}
- mode: 440
- clean: {{ sudoers.purge_includedir }}
{% set included_files = sudoers.included_files %}
{% for included_file, spec in included_files.items() -%}
sudoers include {{ included_file }}: