feat: implement option to purge included files directory
This commit is contained in:
parent
153ac6ea48
commit
c5acbc696a
3 changed files with 10 additions and 0 deletions
|
@ -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'
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
sudoers:
|
||||
pkg: sudo
|
||||
manage_main_config: true
|
||||
purge_includedir: false
|
||||
configpath: /etc
|
||||
group: root
|
||||
execprefix: /usr/sbin
|
||||
|
|
|
@ -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 }}:
|
||||
|
|
Loading…
Reference in a new issue