1
0
Fork 0
mirror of synced 2024-11-22 16:55:36 -05:00

sudoers_prepare test

This commit is contained in:
Kenneth Wilke 2013-08-20 12:10:47 -05:00
parent 0fbaed2a6a
commit abd8e8c67a
4 changed files with 13 additions and 20 deletions

View file

@ -2,18 +2,9 @@ sudoers:
users: users:
# Simple user # Simple user
johndoe: johndoe:
- commands: - ALL: ALL
- ALL # List of users
# Defaults janedoe,marydoe:
janedoe: # Multiple hosts
- hosts: ALL - ALL: ALL
- runas: ALL
- commands:
- ALL
groups:
sudo:
- commands:
# Command tags
- ALL:
- NOPASSWD
#include: /etc/sudoers.d #include: /etc/sudoers.d

View file

@ -1,6 +1,4 @@
{% set sudoers = pillar.get('sudoers', {}) %} {% set sudoers = pillar.get('sudoers', {}) %}
{% set users = sudoers.get('users', {} %}
{% set groups = sudoers.get('users', {} %}
{% set includedir = sudoers.get('includedir', None) %} {% set includedir = sudoers.get('includedir', None) %}
# #
@ -13,7 +11,9 @@
# Cmnd alias specification # Cmnd alias specification
# User privilege specification # User privilege specification
{%- for userspec in users %}
{{ userspec }}
{%- endfor %}
# Group privilege specification # Group privilege specification

View file

@ -0,0 +1,2 @@
def run(**kwargs):
print kwargs

View file

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