2020-07-30 22:05:24 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
---
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2020-07-31 10:54:40 +02:00
|
|
|
{%- from tplroot ~ "/map.jinja" import mapdata with context %}
|
2020-07-30 22:05:24 +02:00
|
|
|
|
2020-12-22 01:43:03 +01:00
|
|
|
{%- do salt['log.debug']('### MAP.JINJA DUMP ###\n' ~ mapdata | yaml(False)) %}
|
2020-07-30 22:05:24 +02:00
|
|
|
|
2020-12-22 01:43:03 +01:00
|
|
|
{%- set output_dir = '/temp' if grains.os_family == 'Windows' else '/tmp' %}
|
|
|
|
{%- set output_file = output_dir ~ '/salt_mapdata_dump.yaml' %}
|
2020-07-30 22:05:24 +02:00
|
|
|
|
|
|
|
{{ tplroot }}-mapdata-dump:
|
|
|
|
file.managed:
|
|
|
|
- name: {{ output_file }}
|
|
|
|
- source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja
|
|
|
|
- template: jinja
|
|
|
|
- context:
|
2020-07-31 10:54:40 +02:00
|
|
|
map: {{ mapdata | yaml }}
|