1
0
Fork 0
mirror of synced 2024-05-29 13:21:10 -04: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 }} %{{ group }} {{ spec }}
{%- endfor %} {%- endfor %}
{%- endfor %} {%- endfor %}
{%- for unix_group in ad_groups.keys() %} {%- for unix_group in ad_groups %}
{%- if unix_group in ad_group_maps.keys() %} {%- if unix_group in ad_group_maps.keys() %}
%{{ unix_group }} {{ ad_group_maps.unix_group }} %{{ unix_group }} {{ ad_group_maps[unix_group] }}
{%- else %} {%- else %}
%{{ unix_group }} {{ ad_group_maps.default }} %{{ unix_group }} {{ ad_group_maps['default'] }}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}

View file

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