mirror of
https://github.com/saltstack-formulas/openssh-formula.git
synced 2024-11-28 03:28:09 +01:00
df477b25c2
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.
22 lines
697 B
Plaintext
22 lines
697 B
Plaintext
{%- set tplroot = tpldir.split('/')[0] %}
|
|
{%- from tplroot ~ "/map.jinja" import mapdata with context %}
|
|
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
|
|
{%- set openssh = mapdata.openssh %}
|
|
|
|
include:
|
|
- openssh
|
|
|
|
sshd_banner:
|
|
file.managed:
|
|
- name: {{ openssh.banner }}
|
|
{%- if openssh.banner_string is defined %}
|
|
- contents: {{ openssh.banner_string | yaml }}
|
|
{%- else %}
|
|
{#- Preserve backward compatibility using the `if` below #}
|
|
- source: {{ openssh.banner_src if '://' in openssh.banner_src
|
|
else files_switch( [openssh.banner_src],
|
|
'sshd_banner'
|
|
) }}
|
|
- template: jinja
|
|
{%- endif %}
|