1
0
Fork 0
mirror of synced 2024-11-05 17:08:56 -05:00

specify group specific value or default

This commit is contained in:
bellaweo 2017-02-15 14:25:03 -08:00
parent c0740ccbff
commit 9fe077af8c
2 changed files with 7 additions and 6 deletions

View file

@ -95,11 +95,11 @@ Runas_Alias {{ name }} = {{ ",".join(runas) }}
%{{ group }} {{ spec }}
{%- endfor %}
{%- endfor %}
{%- for unix_group in ad_groups.keys() %}
{%- for unix_group in ad_groups %}
{%- if unix_group in ad_group_maps.keys() %}
%{{ unix_group }} {{ ad_group_maps.unix_group }}
%{{ unix_group }} {{ ad_group_maps[unix_group] }}
{%- else %}
%{{ unix_group }} {{ ad_group_maps.default }}
%{{ unix_group }} {{ ad_group_maps['default'] }}
{%- endif %}
{%- endfor %}

View file

@ -16,9 +16,10 @@
{% set ad_group_maps = salt['grains.filter_by']({
'default': { 'default': 'ALL = (ALL:ALL) NOPASSWD: SUPPORT' },
'dev': { 'default': 'ALL = (ALL:ALL) NOPASSWD: ALL' },
'qa': { 'default': 'ALL = (ALL:ALL) NOPASSWD: SUPPORT',
'plosqa': 'ALL = (ALL:ALL) NOPASSWD: ALL' },
'vagrant': { 'default': 'ALL = (ALL:ALL) NOPASSWD: ALL' },
'dev': { 'default': 'ALL = (ALL:ALL) NOPASSWD: ALL' },
'qa': { 'default': 'ALL = (ALL:ALL) NOPASSWD: SUPPORT',
'plosqa': 'ALL = (ALL:ALL) NOPASSWD: ALL' },
},
grain='environment',
merge=salt['pillar.get']('group_maps:lookup', None))