2015-01-01 23:14:56 +01:00
|
|
|
{% from "sudoers/map.jinja" import sudoers with context %}
|
2014-10-02 09:29:40 +02:00
|
|
|
|
2014-02-09 18:32:22 +01:00
|
|
|
include:
|
|
|
|
- sudoers
|
|
|
|
|
2015-01-10 23:48:19 +01:00
|
|
|
{% do sudoers.update(pillar.get('sudoers', {})) %}
|
2014-12-24 15:08:03 +01:00
|
|
|
{% set included_files = sudoers.get('included_files', {}) %}
|
2014-02-09 18:32:22 +01:00
|
|
|
{% for included_file,spec in included_files.items() -%}
|
|
|
|
{{ included_file }}:
|
|
|
|
file.managed:
|
|
|
|
- user: root
|
2015-01-01 23:14:56 +01:00
|
|
|
- group: {{ sudoers.get('group', 'root') }}
|
2014-02-09 18:32:22 +01:00
|
|
|
- mode: 440
|
|
|
|
- template: jinja
|
|
|
|
- source: salt://sudoers/files/sudoers
|
2017-08-16 16:52:38 +02:00
|
|
|
- check_cmd: {{ sudoers.get('execprefix', '/usr/sbin') }}/visudo -c -f
|
2014-02-09 18:32:22 +01:00
|
|
|
- context:
|
|
|
|
included: True
|
2015-01-09 16:14:09 +01:00
|
|
|
sudoers: {{ spec|json }}
|
2014-02-09 18:32:22 +01:00
|
|
|
- require:
|
2017-08-16 14:32:42 +02:00
|
|
|
- file: {{ sudoers.get('configpath', '/etc') }}/sudoers
|
2014-02-09 18:32:22 +01:00
|
|
|
{% endfor %}
|