mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-11-28 21:50:18 +01:00
9c202bd60e
... if drop-in file is modified Signed-off-by: Jakub Jelen <jjelen@redhat.com>
40 lines
1.3 KiB
Django/Jinja
40 lines
1.3 KiB
Django/Jinja
{% macro render_option(key,value,indent=false) %}
|
|
{% if value is defined %}
|
|
{% if indent %} {% endif %}
|
|
{% if value is sameas true %}
|
|
{{ key }} yes
|
|
{% elif value is sameas false %}
|
|
{{ key }} no
|
|
{% elif value is string or value is number %}
|
|
{{ key }} {{ value }}
|
|
{% else %}
|
|
{% for i in value %}
|
|
{{ key }} {{ i }}
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endmacro %}
|
|
{% macro body_option(key,override) %}
|
|
{% set value = undefined %}
|
|
{% if override is defined %}
|
|
{% set value = override %}
|
|
{% elif sshd[key] is defined %}
|
|
{% set value = sshd[key] %}
|
|
{% elif __sshd_drop_in_dir and sshd_config_file.startswith(__sshd_drop_in_dir) %}
|
|
{# The drop-in directory does not use the defaults from main file to avoid recursion #}
|
|
{% elif __sshd_defaults[key] is defined and not sshd_skip_defaults %}
|
|
{% if key == 'HostKey' and __sshd_fips_mode %}
|
|
{% set value = __sshd_defaults[key] | difference(__sshd_hostkeys_nofips) %}
|
|
{% else %}
|
|
{% set value = __sshd_defaults[key] %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{{ render_option(key,value) -}}
|
|
{% endmacro %}
|
|
{% macro match_block(match_list) %}
|
|
{% if match_list["Condition"] is defined %}
|
|
{% set match_list = [ match_list ]%}
|
|
{% endif %}
|
|
{% if match_list is iterable %}
|
|
{% for match in match_list %}
|
|
Match {{ match["Condition"] }}
|