1
0
Fork 0
mirror of synced 2024-11-24 09:45:35 -05:00
formula-sudoers/sudoers/included.sls

29 lines
898 B
Text
Raw Normal View History

2015-01-01 17:14:56 -05:00
{% from "sudoers/map.jinja" import sudoers with context %}
2014-10-02 03:29:40 -04:00
include:
- sudoers
{% do sudoers.update(pillar.get('sudoers', {})) %}
{% set includedir = sudoers.get('includedir', '/etc/sudoers.d') %}
{% set included_files = sudoers.get('included_files', {}) %}
{% for included_file,spec in included_files.items() -%}
sudoers include {{ included_file }}:
file.managed:
{% if '/' in included_file %}
- name: {{ included_file }}
{% else %}
- name: {{ includedir }}/{{ included_file }}
{% endif %}
- user: root
2015-01-01 17:14:56 -05:00
- group: {{ sudoers.get('group', 'root') }}
- mode: 440
- template: jinja
- source: salt://sudoers/files/sudoers
- check_cmd: {{ sudoers.get('execprefix', '/usr/sbin') }}/visudo -c -f
- context:
included: True
2015-01-09 10:14:09 -05:00
sudoers: {{ spec|json }}
- require:
- file: {{ sudoers.get('configpath', '/etc') }}/sudoers
{% endfor %}