0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-30 22:15:33 +01:00
openssh-formula/openssh/banner.sls
Imran Iqbal f6dbca3352
fix: complete PR #164
* Use consistent Jinja whitespace control `{%- ... -}`
* Improve debug output (comments & whitespace control)
* Use exact state names with TOFS `files_switch`
* Add `ssh_known_hosts_src` to `defaults` (for consistency)
* Restrict `pillar.example` changes to TOFS only
* Use `fire_banner` in `pillar.example` to indicate available template
2019-07-04 01:42:19 +01:00

21 lines
660 B
Plaintext

{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import openssh with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
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 %}