1
0
Fork 0
mirror of synced 2024-12-22 06:31:06 -05:00
formula-sudoers/sudoers/init.sls

30 lines
738 B
Text
Raw Normal View History

2015-01-01 17:14:56 -05:00
{% from "sudoers/map.jinja" import sudoers with context %}
2013-08-20 17:32:58 -04:00
sudo:
pkg.installed:
- name: {{ sudoers.pkg }}
2013-08-20 17:32:58 -04:00
{% if salt['pillar.get']('sudoers:manage_main_config', True) %}
{{ sudoers.get('configpath', '/etc') }}/sudoers:
2013-08-20 17:32:58 -04:00
file.managed:
- user: root
2015-01-01 17:14:56 -05:00
- group: {{ sudoers.get('group', 'root') }}
2013-08-20 17:32:58 -04:00
- mode: 440
- template: jinja
- source: salt://sudoers/files/sudoers
- check_cmd: {{ sudoers.get('execprefix', '/usr/sbin') }}/visudo -c -f
- context:
included: False
2013-08-20 17:32:58 -04:00
- require:
- pkg: sudo
{% else %}
{{ sudoers.get('configpath', '/etc') }}/sudoers:
test.show_notification:
- name: Skipping management of main sudoers file
- text: Pillar manage_main_config is False
{% endif %}