1
0
Fork 0
mirror of synced 2024-11-24 09:45:35 -05:00
formula-sudoers/sudoers/included.sls
Simon Lloyd 34f3aed102 Fix overwriting dictionary with pillar data.
The dictionary ``sudoers`` is defined twice instead of once,
and then updated with additional values from pillar data. This
prevents looking up map values. This patch updates, instead of
overwrites the dictionary.
2015-01-10 23:48:19 +01:00

21 lines
595 B
Text

{% from "sudoers/map.jinja" import sudoers with context %}
include:
- sudoers
{% do sudoers.update(pillar.get('sudoers', {})) %}
{% set included_files = sudoers.get('included_files', {}) %}
{% for included_file,spec in included_files.items() -%}
{{ included_file }}:
file.managed:
- user: root
- group: {{ sudoers.get('group', 'root') }}
- mode: 440
- template: jinja
- source: salt://sudoers/files/sudoers
- context:
included: True
sudoers: {{ spec|json }}
- require:
- file: {{ sudoers.get('config-path', '/etc') }}/sudoers
{% endfor %}