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