Files
ansible-bind9-role/templates/named.conf.tls.j2
2022-08-04 12:41:40 +02:00

16 lines
1.1 KiB
Django/Jinja

{% macro tls(tlss) %}
{% for tls in tlss if tlss is iterable %}
tls {{ tls.name }} {
{% filter indent(2, true) %}
{{ ('cert-file "' + tls.cert_file + '";\n') if tls.cert_file is defined and tls.cert_file -}}
{{ ('key-file "' + tls.key_file + '";\n') if tls.key_file is defined and tls.key_file -}}
{{ ('dhparam-file "' + tls.dhparam_file + '";\n') if tls.dhparam_file is defined and tls.dhparam_file -}}
{{ ('ca-file "' + tls.ca_file + '";\n') if tls.ca_file is defined and tls.ca_file -}}
{{ ('remote-hostname "' + tls.remote_hostname + '";\n') if tls.remote_hostname is defined and tls.remote_hostname -}}
{{ ('ciphers "' + tls.ciphers + '";\n') if tls.ciphers is defined and tls.ciphers -}}
{{ ('protocols {\n' + functions.simple_item_list(tls.protocols) + '};\n') if tls.protocols is defined and tls.protocols -}}
{{ (functions.boolean_option('prefer-server-ciphers', tls.prefer_server_ciphers) + '\n') if tls.prefer_server_ciphers is defined -}}
{{ (functions.boolean_option('session-tickets', tls.session_tickets) + '\n') if tls.session_tickets is defined -}}
{% endfilter %}};
{% endfor %}
{% endmacro %}