ansible-sshd/meta/10_top.j2

37 lines
1 KiB
Text
Raw Normal View History

# {{ ansible_managed }}
2014-12-25 10:58:55 +01:00
{% macro render_option(key,value,indent=false) %}
{% if value is defined %}
2014-12-25 10:58:55 +01:00
{% if indent == true %} {% 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 %}
2014-12-25 10:58:55 +01:00
{% macro body_option(key,override) %}
{% if override is defined %}
{% set value = override %}
{% elif sshd[key] is defined %}
{% set value = sshd[key] %}
{% elif sshd_defaults[key] is defined and sshd_skip_defaults != true %}
{% set value = sshd_defaults[key] %}
{% endif %}
{% if value is defined %}
2014-12-25 10:58:55 +01:00
{{ render_option(key,value) -}}
{% endif %}
2014-12-25 10:58:55 +01:00
{% endmacro %}
{% macro match_block(match_list) %}
{% 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"] }}