1
0
Fork 0
mirror of synced 2024-11-10 11:38:56 -05:00

Make template and organize pillar scope

This commit is contained in:
hogenj 2015-03-04 16:13:42 -05:00
parent d175f02e84
commit d5ed2c02ec
3 changed files with 17 additions and 15 deletions

View file

@ -2,15 +2,15 @@
sudo: sudo:
pkg.installed: pkg.installed:
- name: {{ sudoers.pkg }} - name: {{ sudoers.lookup.pkg }}
{{ sudoers.get('config-path', '/etc') }}/sudoers: {{ sudoers.get('lookup:config-path', '/etc') }}/sudoers:
file.managed: file.managed:
- user: root - user: root
- group: {{ sudoers.get('group', 'root') }} - group: {{ sudoers.get('lookup:group', 'root') }}
- mode: 440 - mode: 440
- template: jinja - template: jinja
- source: salt://sudoers/files/sudoers - source: salt://sudoers/templates/etc/sudoers
- context: - context:
included: False included: False
- require: - require:

View file

@ -1,14 +1,16 @@
{% set sudoers = salt['grains.filter_by']({ {% set sudoers = salt['grains.filter_by']({
'Debian': {'pkg': 'sudo'},
'Ubuntu': {'pkg': 'sudo'}, 'Debian': { 'lookup': {'pkg': 'sudo'}},
'CentOS': {'pkg': 'sudo'}, 'Ubuntu': { 'lookup': {'pkg': 'sudo'}},
'Fedora': {'pkg': 'sudo'}, 'CentOS': { 'lookup':{'pkg': 'sudo'}},
'RedHat': {'pkg': 'sudo'}, 'Fedora': { 'lookup':{'pkg': 'sudo'}},
'Amazon': {'pkg': 'sudo'}, 'RedHat': { 'lookup':{'pkg': 'sudo'}},
'Gentoo': {'pkg': 'app-admin/sudo'}, 'Amazon': { 'lookup':{'pkg': 'sudo'}},
'Mint': {'pkg': 'sudo'}, 'Gentoo': { 'lookup':{'pkg': 'app-admin/sudo'}},
'Arch': {'pkg': 'sudo'}, 'Mint': { 'lookup':{'pkg': 'sudo'}},
'FreeBSD': {'pkg': 'sudo', 'Arch': { 'lookup':{'pkg': 'sudo'}},
'FreeBSD': { 'lookup':{'pkg': 'sudo',
'config-path': '/usr/local/etc', 'config-path': '/usr/local/etc',
'group': 'wheel'}, 'group': 'wheel'},
}, merge=salt['pillar.get']('sudoers:lookup')) %} },
}, merge=salt['pillar.get']('sudoers')) %}