2020-08-25 00:03:17 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
---
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
2020-12-22 17:18:14 -05:00
|
|
|
{%- set tplroot = tpldir.split("/")[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import sudoers with context %}
|
2020-08-25 00:03:17 -04:00
|
|
|
|
2020-12-22 17:18:14 -05:00
|
|
|
{%- set _mapdata = {
|
2021-01-14 15:35:46 -05:00
|
|
|
"values": sudoers,
|
2020-12-22 17:18:14 -05:00
|
|
|
} %}
|
|
|
|
{%- do salt["log.debug"]("### MAP.JINJA DUMP ###\n" ~ _mapdata | yaml(False)) %}
|
2020-08-25 00:03:17 -04:00
|
|
|
|
2020-12-22 17:18:14 -05:00
|
|
|
{%- set output_dir = "/temp" if grains.os_family == "Windows" else "/tmp" %}
|
|
|
|
{%- set output_file = output_dir ~ "/salt_mapdata_dump.yaml" %}
|
2020-08-25 00:03:17 -04:00
|
|
|
|
|
|
|
{{ tplroot }}-mapdata-dump:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ output_file }}
|
|
|
|
- source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja
|
|
|
|
- template: jinja
|
|
|
|
- context:
|
2020-12-22 17:18:14 -05:00
|
|
|
map: {{ _mapdata | yaml }}
|