mirror of
https://github.com/saltstack-formulas/sudoers-formula.git
synced 2024-11-28 00:48:12 +01:00
Merge pull request #39 from jasonvoor/master
added includedir as variable (mostly for FreeBSD)
This commit is contained in:
commit
1a46975212
@ -45,6 +45,7 @@ sudoers:
|
|||||||
users:
|
users:
|
||||||
foo:
|
foo:
|
||||||
- 'ALL=(ALL) ALL'
|
- 'ALL=(ALL) ALL'
|
||||||
|
extra-file-2:
|
||||||
groups:
|
groups:
|
||||||
bargroup:
|
bargroup:
|
||||||
- 'ALL=(ALL) NOPASSWD: ALL'
|
- 'ALL=(ALL) NOPASSWD: ALL'
|
||||||
|
@ -4,10 +4,16 @@ include:
|
|||||||
- sudoers
|
- sudoers
|
||||||
|
|
||||||
{% do sudoers.update(pillar.get('sudoers', {})) %}
|
{% do sudoers.update(pillar.get('sudoers', {})) %}
|
||||||
|
{% set includedir = sudoers.get('includedir', '/etc/sudoers.d') %}
|
||||||
{% set included_files = sudoers.get('included_files', {}) %}
|
{% set included_files = sudoers.get('included_files', {}) %}
|
||||||
{% for included_file,spec in included_files.items() -%}
|
{% for included_file,spec in included_files.items() -%}
|
||||||
{{ included_file }}:
|
sudoers include {{ included_file }}:
|
||||||
file.managed:
|
file.managed:
|
||||||
|
{% if '/' in included_file %}
|
||||||
|
- name: {{ included_file }}
|
||||||
|
{% else %}
|
||||||
|
- name: {{ includedir }}/{{ included_file }}
|
||||||
|
{% endif %}
|
||||||
- user: root
|
- user: root
|
||||||
- group: {{ sudoers.get('group', 'root') }}
|
- group: {{ sudoers.get('group', 'root') }}
|
||||||
- mode: 440
|
- mode: 440
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
'Suse': {'pkg': 'sudo'},
|
'Suse': {'pkg': 'sudo'},
|
||||||
'FreeBSD': {'pkg': 'sudo',
|
'FreeBSD': {'pkg': 'sudo',
|
||||||
'configpath': '/usr/local/etc',
|
'configpath': '/usr/local/etc',
|
||||||
|
'includedir': '/usr/local/etc/sudoers.d',
|
||||||
'execprefix': '/usr/local/sbin',
|
'execprefix': '/usr/local/sbin',
|
||||||
'group': 'wheel'},
|
'group': 'wheel'},
|
||||||
}, merge=salt['pillar.get']('sudoers:lookup')) %}
|
}, merge=salt['pillar.get']('sudoers:lookup')) %}
|
||||||
|
Loading…
Reference in New Issue
Block a user