From 31692dd78d5b2e95b85351d744de88f470a49e95 Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Tue, 14 May 2024 13:44:21 +0200 Subject: [PATCH] Demacro dlz --- templates/named.conf.dlz.j2 | 4 +--- templates/named.conf.generator.j2 | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/templates/named.conf.dlz.j2 b/templates/named.conf.dlz.j2 index f47e9b2..3d89dd5 100644 --- a/templates/named.conf.dlz.j2 +++ b/templates/named.conf.dlz.j2 @@ -1,5 +1,4 @@ -{% macro dlz(dlzs) %} -{% for dlz in dlzs if dlzs is iterable %} +{% for dlz in item.dlz if item.dlz is iterable %} dlz "{{ dlz.name }}" { {% filter indent(bind9_config_indent, true) %} {{ ('database "' + simple_item_list(dlz.database) + '";') }} @@ -7,4 +6,3 @@ dlz "{{ dlz.name }}" { {% endfilter %} }; {% endfor %} -{% endmacro %} \ No newline at end of file diff --git a/templates/named.conf.generator.j2 b/templates/named.conf.generator.j2 index 3c25aa9..757875f 100644 --- a/templates/named.conf.generator.j2 +++ b/templates/named.conf.generator.j2 @@ -21,8 +21,7 @@ options { {% include 'named.conf.include.j2' %} {% endif %} {% if item.dlz is defined and item.dlz %} -{% from 'named.conf.dlz.j2' import dlz with context %} -{{ dlz(item.dlz) }} +{% include 'named.conf.dlz.j2' %} {% endif %} {% if item.dnssec_policy is defined and item.dnssec_policy %} {% from 'named.conf.dnssec-policy.j2' import dnssec_policy with context %}