1
0
Fork 0
mirror of synced 2024-10-31 16:08:56 -04:00
This commit is contained in:
gmarone 2018-03-07 00:02:12 +00:00 committed by GitHub
commit cd65db744e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -7,6 +7,10 @@ sudoers:
sudo:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
network_groups:
my-network-admin-group:
- 'ALL=(ALL) ALL'
- 'ALL=(nodejs) NOPASSWD: ALL'
defaults:
generic:
- env_reset

View file

@ -13,6 +13,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {'root': ['ALL=(ALL:ALL) ALL']}) %}
{%- set groups = sudoers.get('groups', {'sudo': ['ALL=(ALL:ALL) ALL']}) %}
{%- set network_groups = sudoers.get('network_groups', {'sudo': ['ALL=(ALL:ALL) ALL']}) %}
{%- else %}
{%- set defaults = sudoers.get('defaults', {}) %}
{%- set generic_defaults = defaults.get('generic', []) %}
@ -22,6 +23,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {}) %}
{%- set groups = sudoers.get('groups', {}) %}
{%- set network_groups = sudoers.get('network_groups', {}) %}
{%- endif %}
{%- set includedir = sudoers.get('includedir', '/etc/sudoers.d') -%}
{%- else %}
@ -33,6 +35,7 @@
{%- set runas_list_defaults = defaults.get('runas_list', {}) %}
{%- set users = sudoers.get('users', {}) %}
{%- set groups = sudoers.get('groups', {}) %}
{%- set network_groups = sudoers.get('network_groups', {}) %}
{%- set includedir = sudoers.get('includedir', None) %}
{%- endif %}
{%- set aliases = sudoers.get('aliases', {}) %}
@ -95,6 +98,13 @@ Runas_Alias {{ name }} = {{ ",".join(runas) }}
{%- endfor %}
{%- endfor %}
# Network Group privilege specification
{%- for group,specs in network_groups.items() %}
{%- for spec in specs %}
+{{ group }} {{ spec }}
{%- endfor %}
{%- endfor %}
{% if includedir %}
## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)