-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
929 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
{% from "sudoers/map.jinja" import sudoers with context %} | ||
# -*- 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 %} | ||
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() -%} | ||
{% set included_files = sudoers.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 }} | ||
- name: {{ sudoers.includedir }}/{{ included_file }} | ||
{% endif %} | ||
- user: root | ||
- group: {{ sudoers.get('group', 'root') }} | ||
- group: {{ sudoers.group }} | ||
- mode: 440 | ||
- makedirs: True | ||
- template: jinja | ||
- source: salt://sudoers/files/sudoers | ||
- check_cmd: {{ sudoers.get('execprefix', '/usr/sbin') }}/visudo -c -f | ||
- check_cmd: {{ sudoers.execprefix }}/visudo -c -f | ||
- context: | ||
included: True | ||
sudoers: {{ spec|json }} | ||
{% if salt['pillar.get']('sudoers:manage_main_config', True) %} | ||
{% if sudoers.manage_main_config %} | ||
- require: | ||
- file: {{ sudoers.get('configpath', '/etc') }}/sudoers | ||
- file: {{ sudoers.configpath }}/sudoers | ||
{% endif %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.