From c510418964300708654db579cd833303ad406271 Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Tue, 14 May 2024 14:30:18 +0200 Subject: [PATCH] refactor: Remove macro usage from TLS configuration template --- templates/named.conf.generator.j2 | 4 +--- templates/named.conf.tls.j2 | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/templates/named.conf.generator.j2 b/templates/named.conf.generator.j2 index e671892..f025edd 100644 --- a/templates/named.conf.generator.j2 +++ b/templates/named.conf.generator.j2 @@ -46,11 +46,9 @@ options { {% endif %} {% if item.statistics_channels is defined and item.statistics_channels %} {% include 'named.conf.statistics-channels.j2' %} -{{ statistics_channels(item.statistics_channels) }} {% endif %} {% if item.tls is defined and item.tls %} -{% from 'named.conf.tls.j2' import tls with context %} -{{ tls(item.tls) }} +{% include 'named.conf.tls.j2' %} {% endif %} {% if item.trust_anchors is defined and item.trust_anchors %} {% from 'named.conf.trust-anchors.j2' import trust_anchors with context %} diff --git a/templates/named.conf.tls.j2 b/templates/named.conf.tls.j2 index 37b9aff..63cf816 100644 --- a/templates/named.conf.tls.j2 +++ b/templates/named.conf.tls.j2 @@ -1,5 +1,4 @@ -{% macro tls(tlss) %} -{% for tls in tlss if tlss is iterable %} +{% for tls in item.tls if item.tls is iterable %} tls {{ tls.name }} { {% filter indent(bind9_config_indent, true) %} {{ ('cert-file "' + tls.cert_file + '";\n') if tls.cert_file is defined and tls.cert_file -}} @@ -13,4 +12,3 @@ tls {{ tls.name }} { {{ (functions.boolean_option('session-tickets', tls.session_tickets) + '\n') if tls.session_tickets is defined -}} {% endfilter %}}; {% endfor %} -{% endmacro %} \ No newline at end of file