0
0
mirror of https://github.com/saltstack-formulas/sudoers-formula.git synced 2025-02-26 02:18:34 +01:00
sudoers-formula/sudoers/included.sls
2016-03-09 15:03:56 -05:00

23 lines
671 B
Plaintext

{% from "sudoers/map.jinja" import sudoers with context %}
include:
- sudoers
{% do sudoers.update(pillar.get('sudoers', {})) %}
{% set included_files = sudoers.get('included_files', {}) %}
{% for included_file,spec in included_files.items() -%}
{{ included_file }}:
file.managed:
- user: root
- group: {{ sudoers.get('group', 'root') }}
- mode: 440
- template: jinja
- source: salt://sudoers/files/sudoers
- check_cmd: {{ sudoers.get('exec-prefix', '/usr/sbin') }}/visudo -c -f
- context:
included: True
sudoers: {{ spec|json }}
- require:
- file: {{ sudoers.get('config-path', '/etc') }}/sudoers
{% endfor %}