feat: implement option to purge included files directory

pull/66/head
Eric Veiras Galisson 3 years ago
parent 153ac6ea48
commit c5acbc696a
  1. 2
      pillar.example
  2. 1
      sudoers/defaults.yaml
  3. 7
      sudoers/included.sls

@ -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…
Cancel
Save