2020-08-24 17:26:54 +02: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 23:32:58 +02:00
|
|
|
|
|
|
|
sudo:
|
|
|
|
pkg.installed:
|
2015-01-01 23:19:47 +01:00
|
|
|
- name: {{ sudoers.pkg }}
|
2013-08-20 23:32:58 +02:00
|
|
|
|
2020-08-24 17:26:54 +02:00
|
|
|
{% if sudoers.manage_main_config %}
|
2018-08-22 12:14:02 +02:00
|
|
|
|
2020-08-24 17:26:54 +02:00
|
|
|
{{ sudoers.configpath }}/sudoers:
|
2013-08-20 23:32:58 +02:00
|
|
|
file.managed:
|
|
|
|
- user: root
|
2020-08-24 17:26:54 +02:00
|
|
|
- group: {{ sudoers.group }}
|
2013-08-20 23:32:58 +02:00
|
|
|
- mode: 440
|
|
|
|
- template: jinja
|
|
|
|
- source: salt://sudoers/files/sudoers
|
2020-08-24 17:26:54 +02:00
|
|
|
- check_cmd: {{ sudoers.execprefix }}/visudo -c -f
|
2014-02-09 18:32:22 +01:00
|
|
|
- context:
|
|
|
|
included: False
|
2013-08-20 23:32:58 +02:00
|
|
|
- require:
|
|
|
|
- pkg: sudo
|
2018-08-22 12:14:02 +02:00
|
|
|
|
|
|
|
{% else %}
|
|
|
|
|
2020-08-24 17:26:54 +02:00
|
|
|
{{ sudoers.configpath }}/sudoers:
|
2018-08-22 12:14:02 +02:00
|
|
|
test.show_notification:
|
|
|
|
- name: Skipping management of main sudoers file
|
|
|
|
- text: Pillar manage_main_config is False
|
|
|
|
|
|
|
|
{% endif %}
|