1
0
Fork 0
This commit is contained in:
Kenneth Wilke 2013-08-20 10:35:17 -07:00
commit 5ec0f1c7c9
5 changed files with 48 additions and 1 deletions

View File

@ -1,7 +1,7 @@
sudoers
=======
Set up the sudoers file
Set up the sudoers file (WORK IN PROGRESS)
.. note::

10
pillar.example Normal file
View File

@ -0,0 +1,10 @@
sudoers:
users:
# Simple user
johndoe:
- ALL: ALL
# List of users
janedoe,marydoe:
# Multiple hosts
- ALL: ALL
#include: /etc/sudoers.d

22
sudoers/files/sudoers Normal file
View File

@ -0,0 +1,22 @@
{% set sudoers = pillar.get('sudoers', {}) %}
{% set includedir = sudoers.get('includedir', None) %}
#
# This file is managed by salt
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
{{ users }}
# Group privilege specification
{% if includes %}
includedir {{ includedir }}
{% else %}
#includedir /etc/sudoers.d
{% endif %}

View File

@ -0,0 +1,5 @@
import salt.renderers.jinja as jinja
def run():
sudoers = pillar.get('sudoers', {})
return jinja.render('sudoers/files/sudoers', users=sudoers.get('users', {}))

10
sudoers/init.sls Normal file
View File

@ -0,0 +1,10 @@
sudo:
pkg.installed
/etc/sudoers.test:
file.managed:
- user: root
- group: root
- mode: 440
- template: py
- source: salt://sudoers/files/sudoers_prepare.py