From fa01a5983573e3e4ca26fea21397e12a687682c8 Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Tue, 14 May 2024 14:34:49 +0200 Subject: [PATCH] refactor: Simplify trust-anchors template implementation --- templates/named.conf.generator.j2 | 3 +-- templates/named.conf.trust-anchors.j2 | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/named.conf.generator.j2 b/templates/named.conf.generator.j2 index f025edd..56bd502 100644 --- a/templates/named.conf.generator.j2 +++ b/templates/named.conf.generator.j2 @@ -51,8 +51,7 @@ options { {% 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 %} -{{ trust_anchors(item.trust_anchors) }} +{% include 'named.conf.trust-anchors.j2' %} {% endif %} {% if item.zones is defined and item.zones %} {% from 'named.conf.zone.j2' import zones with context %} diff --git a/templates/named.conf.trust-anchors.j2 b/templates/named.conf.trust-anchors.j2 index 033fb57..b4669ac 100644 --- a/templates/named.conf.trust-anchors.j2 +++ b/templates/named.conf.trust-anchors.j2 @@ -1,7 +1,6 @@ -{% macro trust_anchors(trust_anchors) %} trust-anchors { {% filter indent(bind9_config_indent, true) %} -{% for anchor in trust_anchors if trust_anchors is iterable %} +{% for anchor in item.trust_anchors if item.trust_anchors is iterable %} {{ (anchor.name | string) -}} {{ (' ' + anchor.type) -}} {{ (' ' + anchor.flags | string) -}} @@ -10,4 +9,3 @@ trust-anchors { {{ (' "' + anchor.key + '"') -}}; {% endfor %} {% endfilter %}}; -{% endmacro %} \ No newline at end of file