mirror of
https://github.com/saltstack-formulas/openssh-formula.git
synced 2026-10-24 05:40:46 +02:00
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
This commit is contained in:
5 files changed
+35
-42
No files matched your search
+14
-16
@@ -1,20 +1,19 @@
|
||||
{% set tplroot = tpldir.split('/')[0] %}
|
||||
{% from tplroot ~ "/map.jinja" import openssh, ssh_config, sshd_config with context %}
|
||||
{% from tplroot ~ "/libtofs.jinja" import files_switch %}
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import openssh, ssh_config, sshd_config with context %}
|
||||
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
|
||||
|
||||
|
||||
include:
|
||||
- openssh
|
||||
|
||||
{% if sshd_config %}
|
||||
{%- if sshd_config %}
|
||||
sshd_config:
|
||||
file.managed:
|
||||
- name: {{ openssh.sshd_config }}
|
||||
# Preserve backward compatibility
|
||||
- source: {{ openssh.sshd_config_src
|
||||
if '://' in openssh.sshd_config_src
|
||||
{#- Preserve backward compatibility using the `if` below #}
|
||||
- source: {{ openssh.sshd_config_src if '://' in openssh.sshd_config_src
|
||||
else files_switch( [openssh.sshd_config_src],
|
||||
'sshd_config_file_managed'
|
||||
'sshd_config'
|
||||
) }}
|
||||
- template: jinja
|
||||
- user: {{ openssh.sshd_config_user }}
|
||||
@@ -26,17 +25,16 @@ sshd_config:
|
||||
{%- endif %}
|
||||
- watch_in:
|
||||
- service: {{ openssh.service }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
{% if ssh_config %}
|
||||
{%- if ssh_config %}
|
||||
ssh_config:
|
||||
file.managed:
|
||||
- name: {{ openssh.ssh_config }}
|
||||
# Preserve backward compatibility
|
||||
- source: {{ openssh.ssh_config_src
|
||||
if '://' in openssh.ssh_config_src
|
||||
{#- Preserve backward compatibility using the `if` below #}
|
||||
- source: {{ openssh.ssh_config_src if '://' in openssh.ssh_config_src
|
||||
else files_switch( [openssh.ssh_config_src],
|
||||
'ssh_config_file_managed'
|
||||
'ssh_config'
|
||||
) }}
|
||||
- template: jinja
|
||||
- user: {{ openssh.ssh_config_user }}
|
||||
@@ -45,7 +43,7 @@ ssh_config:
|
||||
{%- if openssh.ssh_config_backup %}
|
||||
- backup: minion
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
|
||||
{%- for keyType in openssh['host_key_algos'].split(',') %}
|
||||
{%- set keyFile = "/etc/ssh/ssh_host_" ~ keyType ~ "_key" %}
|
||||
@@ -134,4 +132,4 @@ ssh_host_{{ keyType }}_key.pub:
|
||||
- file: sshd_config
|
||||
- watch_in:
|
||||
- service: {{ openssh.service }}
|
||||
{% endif %}
|
||||
{%- endif %}
|
||||
Reference in new issue
Block a user