mirror of
https://github.com/saltstack-formulas/openssh-formula.git
synced 2026-09-21 21:27:24 +02:00
feat(map): update to v4 “map.jinja”
The `map.jinja` now exports a single variable called `mapdata`. We extract the `openssh`, `sshd_config` and `ssh_config` from it to minimize the changes to `.sls` files.
This commit is contained in:
@@ -3,18 +3,11 @@
|
||||
---
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import openssh with context %}
|
||||
{%- from tplroot ~ "/map.jinja" import ssh_config with context %}
|
||||
{%- from tplroot ~ "/map.jinja" import sshd_config with context %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata with context %}
|
||||
|
||||
{%- set output_file = '/tmp/salt_mapdata_dump.yaml' %}
|
||||
{%- set map = {
|
||||
'openssh': openssh,
|
||||
'ssh_config': ssh_config,
|
||||
'sshd_config': sshd_config,
|
||||
} %}
|
||||
|
||||
{%- do salt['log.debug']( map | yaml(False) ) %}
|
||||
{%- do salt['log.debug']( mapdata | yaml(False) ) %}
|
||||
|
||||
{{ tplroot }}-mapdata-dump:
|
||||
file.managed:
|
||||
@@ -22,4 +15,4 @@
|
||||
- source: salt://{{ tplroot }}/_mapdata/_mapdata.jinja
|
||||
- template: jinja
|
||||
- context:
|
||||
map: {{ map | yaml }}
|
||||
map: {{ mapdata | yaml }}
|
||||
|
||||
Reference in New Issue
Block a user