2013-08-20 17:32:58 -04:00
|
|
|
{% set sudoers = pillar.get('sudoers', {}) %}
|
|
|
|
{% set defaults = sudoers.get('defaults', []) %}
|
|
|
|
{% set aliases = sudoers.get('aliases', {}) %}
|
2013-08-20 17:45:11 -04:00
|
|
|
{% set host_aliases = aliases.get('hosts', []) %}
|
|
|
|
{% set user_aliases = aliases.get('users', []) %}
|
2013-08-20 17:32:58 -04:00
|
|
|
{% set cmnd_aliases = aliases.get('commands', []) %}
|
|
|
|
{% set runas_aliases = aliases.get('runas', []) %}
|
|
|
|
{% set users = sudoers.get('users', {}) %}
|
|
|
|
{% set groups = sudoers.get('groups', {}) %}
|
|
|
|
{% set includedir = sudoers.get('includedir', None) %}
|
|
|
|
#
|
|
|
|
# This file is managed by salt
|
|
|
|
#
|
|
|
|
|
|
|
|
{% for default in defaults -%}
|
|
|
|
Defaults {{ default }}
|
2013-08-20 17:45:11 -04:00
|
|
|
{% endfor %}
|
2013-08-20 17:32:58 -04:00
|
|
|
|
|
|
|
# Host alias specification
|
2013-08-20 17:45:11 -04:00
|
|
|
{% for name,hosts in host_aliases.items() %}
|
|
|
|
Host_Alias {{ name }} = {{ ",".join(hosts) }}
|
|
|
|
{% endfor %}
|
2013-08-20 17:32:58 -04:00
|
|
|
|
|
|
|
# User alias specification
|
|
|
|
{{ user_aliases }}
|
|
|
|
|
|
|
|
# Cmnd alias specification
|
|
|
|
{{ cmnd_aliases }}
|
|
|
|
|
|
|
|
# Runas alias specification
|
|
|
|
{{ runas_aliases }}
|
|
|
|
|
|
|
|
# User privilege specification
|
|
|
|
{{ users }}
|
|
|
|
|
|
|
|
# Group privilege specification
|
|
|
|
{{ groups }}
|
|
|
|
|
2013-08-20 17:35:57 -04:00
|
|
|
{% if includedir %}
|
2013-08-20 17:32:58 -04:00
|
|
|
includedir {{ includedir }}
|
|
|
|
{% else %}
|
|
|
|
#includedir /etc/sudoers.d
|
|
|
|
{% endif %}
|