Last active
December 27, 2015 00:09
-
-
Save ewdurbin/7235624 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudoer_groups: | |
kmadmin: | |
commands: | |
- "ALL=(ALL) NOPASSWD: ALL" | |
kissmetrics: | |
commands: | |
- "ALL = NOPASSWD: /bin/su - km-legacy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for sudoer_group in sudoers.split(',') %} | |
{% for command in pillar['sudoer_groups'][sudoer_group]['commands'] %} | |
%{{sudoer_group}} {{command}} | |
{% endfor %} | |
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for group in pillar.get('sudoer_groups', {}) %} | |
{{ group }}-sudoer_group: | |
group.present: | |
- name: {{ group }} | |
{% endfor %} | |
/etc/sudoers.d/salt: | |
file.managed: | |
- source: salt://salt-sudoers.jinja | |
- template: jinja | |
- context: | |
sudoers: {{ pillar.get('sudoer_groups', {}).keys()|join(',') }} | |
- user: root | |
- group: root | |
- mode: 640 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment