2014-12-25 10:58:55 +01:00
|
|
|
{% macro render_option(key,value,indent=false) %}
|
2014-12-21 21:29:13 +01:00
|
|
|
{% if value is defined %}
|
2021-05-21 17:57:24 +02:00
|
|
|
{% if indent %} {% endif %}
|
2014-12-21 23:23:02 +01:00
|
|
|
{% if value is sameas true %}
|
|
|
|
{{ key }} yes
|
|
|
|
{% elif value is sameas false %}
|
|
|
|
{{ key }} no
|
|
|
|
{% elif value is string or value is number %}
|
2014-12-21 21:29:13 +01:00
|
|
|
{{ key }} {{ value }}
|
|
|
|
{% else %}
|
|
|
|
{% for i in value %}
|
|
|
|
{{ key }} {{ i }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
{% endmacro %}
|
2014-12-25 10:58:55 +01:00
|
|
|
{% macro body_option(key,override) %}
|
2016-01-24 16:49:54 +01:00
|
|
|
{% set value = undefined %}
|
2014-12-25 10:58:55 +01:00
|
|
|
{% if override is defined %}
|
|
|
|
{% set value = override %}
|
|
|
|
{% elif sshd[key] is defined %}
|
|
|
|
{% set value = sshd[key] %}
|
2021-05-21 17:57:24 +02:00
|
|
|
{% elif __sshd_defaults[key] is defined and not sshd_skip_defaults %}
|
2018-08-25 23:39:06 +02:00
|
|
|
{% set value = __sshd_defaults[key] %}
|
2014-12-25 10:58:55 +01:00
|
|
|
{% endif %}
|
|
|
|
{{ render_option(key,value) -}}
|
|
|
|
{% endmacro %}
|
|
|
|
{% macro match_block(match_list) %}
|
2014-12-25 13:14:32 +01:00
|
|
|
{% if match_list["Condition"] is defined %}
|
|
|
|
{% set match_list = [ match_list ]%}
|
|
|
|
{% endif %}
|
|
|
|
{% if match_list is iterable %}
|
2014-12-25 10:58:55 +01:00
|
|
|
{% for match in match_list %}
|
|
|
|
Match {{ match["Condition"] }}
|