1
0
Fork 0
mirror of synced 2024-12-21 06:01:07 -05:00

allow for multiple lines for the same user or group

This commit is contained in:
Robert Fairburn 2014-08-19 09:26:47 -05:00
parent 24ae95394f
commit cd1ddcf25f
2 changed files with 16 additions and 6 deletions

View file

@ -1,8 +1,12 @@
sudoers:
users:
johndoe: 'ALL=(ALL) ALL'
johndoe:
- 'ALL=(ALL) ALL'
- 'ALL=(root) NOPASSWD: /etc/init.d/httpd'
groups:
sudo: 'ALL=(ALL) NOPASSWD: ALL'
sudo:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
defaults:
generic:
- env_rset
@ -39,6 +43,8 @@ sudoers:
included_files:
/etc/sudoers.d/extra-file:
users:
foo: 'ALL=(ALL) ALL'
foo:
- 'ALL=(ALL) ALL'
groups:
bargroup: 'ALL=(ALL) NOPASSWD: ALL'
bargroup:
- 'ALL=(ALL) NOPASSWD: ALL'

View file

@ -82,13 +82,17 @@ Runas_Alias {{ name }} = {{ ",".join(runas) }}
{%- endfor %}
# User privilege specification
{%- for user,spec in users.items() %}
{%- for user,specs in users.items() %}
{%- for spec in specs %}
{{ user }} {{ spec }}
{%- endfor %}
{%- endfor %}
# Group privilege specification
{%- for group,spec in groups.items() %}
{%- for group,specs in groups.items() %}
{%- for spec in specs %}
%{{ group }} {{ spec }}
{%- endfor %}
{%- endfor %}
{% if includedir %}