sudoers_prepare test
This commit is contained in:
parent
0fbaed2a6a
commit
abd8e8c67a
4 changed files with 13 additions and 20 deletions
|
@ -2,18 +2,9 @@ sudoers:
|
|||
users:
|
||||
# Simple user
|
||||
johndoe:
|
||||
- commands:
|
||||
- ALL
|
||||
# Defaults
|
||||
janedoe:
|
||||
- hosts: ALL
|
||||
- runas: ALL
|
||||
- commands:
|
||||
- ALL
|
||||
groups:
|
||||
sudo:
|
||||
- commands:
|
||||
# Command tags
|
||||
- ALL:
|
||||
- NOPASSWD
|
||||
- ALL: ALL
|
||||
# List of users
|
||||
janedoe,marydoe:
|
||||
# Multiple hosts
|
||||
- ALL: ALL
|
||||
#include: /etc/sudoers.d
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
{% set sudoers = pillar.get('sudoers', {}) %}
|
||||
{% set users = sudoers.get('users', {} %}
|
||||
{% set groups = sudoers.get('users', {} %}
|
||||
{% set includedir = sudoers.get('includedir', None) %}
|
||||
|
||||
#
|
||||
|
@ -13,7 +11,9 @@
|
|||
# Cmnd alias specification
|
||||
|
||||
# User privilege specification
|
||||
|
||||
{%- for userspec in users %}
|
||||
{{ userspec }}
|
||||
{%- endfor %}
|
||||
|
||||
# Group privilege specification
|
||||
|
||||
|
|
2
sudoers/files/sudoers_prepare.py
Normal file
2
sudoers/files/sudoers_prepare.py
Normal file
|
@ -0,0 +1,2 @@
|
|||
def run(**kwargs):
|
||||
print kwargs
|
|
@ -1,10 +1,10 @@
|
|||
sudo:
|
||||
pkg.installed
|
||||
|
||||
/etc/sudoers:
|
||||
/etc/sudoers.test:
|
||||
file.managed:
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 440
|
||||
- template: jinja
|
||||
- source: salt://sudoders/files/sudoers
|
||||
- template: py
|
||||
- source: salt://sudoers/files/sudoers.py
|
||||
|
|
Loading…
Reference in a new issue