1
0
Fork 0
mirror of synced 2024-11-16 06:05:35 -05:00
formula-sudoers/sudoers/init.sls

36 lines
823 B
Text
Raw Normal View History

2020-08-24 11:26:54 -04:00
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- from tplroot ~ "/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
2020-08-24 11:26:54 -04:00
{% if sudoers.manage_main_config %}
2020-08-24 11:26:54 -04:00
{{ sudoers.configpath }}/sudoers:
2013-08-20 17:32:58 -04:00
file.managed:
- user: root
2020-08-24 11:26:54 -04:00
- group: {{ sudoers.group }}
2013-08-20 17:32:58 -04:00
- mode: 440
- template: jinja
- source: salt://sudoers/files/sudoers
2020-08-24 11:26:54 -04:00
- check_cmd: {{ sudoers.execprefix }}/visudo -c -f
- context:
included: False
2013-08-20 17:32:58 -04:00
- require:
- pkg: sudo
{% else %}
2020-08-24 11:26:54 -04:00
{{ sudoers.configpath }}/sudoers:
test.show_notification:
- name: Skipping management of main sudoers file
- text: Pillar manage_main_config is False
{% endif %}