Merge 95d9033068
into d9f1a84b78
This commit is contained in:
commit
5ec0f1c7c9
|
@ -1,7 +1,7 @@
|
||||||
sudoers
|
sudoers
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Set up the sudoers file
|
Set up the sudoers file (WORK IN PROGRESS)
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
sudoers:
|
||||||
|
users:
|
||||||
|
# Simple user
|
||||||
|
johndoe:
|
||||||
|
- ALL: ALL
|
||||||
|
# List of users
|
||||||
|
janedoe,marydoe:
|
||||||
|
# Multiple hosts
|
||||||
|
- ALL: ALL
|
||||||
|
#include: /etc/sudoers.d
|
|
@ -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 %}
|
|
@ -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', {}))
|
|
@ -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
|
Loading…
Reference in New Issue