2020-08-25 00:03:17 -04:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
---
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2020-12-21 19:43:11 -05:00
|
|
|
{%- from tplroot ~ "/map.jinja" import sudoers as mapdata with context %}
|
2020-08-25 00:03:17 -04:00
|
|
|
|
2020-12-21 19:43:11 -05:00
|
|
|
{%- do salt['log.debug']('### MAP.JINJA DUMP ###\n' ~ mapdata | yaml(False)) %}
|
2020-08-25 00:03:17 -04:00
|
|
|
|
2020-12-21 19:43:11 -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-21 19:43:11 -05:00
|
|
|
map: {{ mapdata | yaml }}
|