This commit is contained in:
Daniel Akulenok
2024-05-14 14:12:19 +02:00
parent 8077d8c05c
commit 52d5fa2d3f
3 changed files with 5 additions and 12 deletions

View File

@@ -34,15 +34,12 @@ options {
{% endif %} {% endif %}
{% if item.keylist is defined and item.keylist %} {% if item.keylist is defined and item.keylist %}
{% include 'named.conf.key.j2' %} {% include 'named.conf.key.j2' %}
{{ keylist(item.keylist) }}
{% endif %} {% endif %}
{% if item.logging is defined and item.logging %} {% if item.logging is defined and item.logging %}
{% from 'named.conf.logging.j2' import logging with context %} {% include 'named.conf.logging.j2' %}
{{ logging(item.logging) }}
{% endif %} {% endif %}
{% if item.parental_agents is defined and item.parental_agents %} {% if item.parental_agents is defined and item.parental_agents %}
{% from 'named.conf.parental-agents.j2' import parental_agents with context %} {% include 'named.conf.parental-agents.j2' %}
{{ parental_agents(item.parental_agents) -}}
{% endif %} {% endif %}
{% if item.server is defined and item.server %} {% if item.server is defined and item.server %}
{% from 'named.conf.server.j2' import server with context %} {% from 'named.conf.server.j2' import server with context %}

View File

@@ -1,11 +1,10 @@
{% macro logging(logging) %}
logging { logging {
{% filter indent(bind9_config_indent, true) %} {% filter indent(bind9_config_indent, true) %}
{% for category in logging.categories if logging.categories is defined and logging.categories %} {% for category in item.logging.categories if item.logging.categories is defined and item.logging.categories %}
category {{ category.name }} { category {{ category.name }} {
{{ functions.simple_item_list(category.channels) }}}; {{ functions.simple_item_list(category.channels) }}};
{% endfor %} {% endfor %}
{% for channel in logging.channels if logging.channels is defined and logging.channels %} {% for channel in item.logging.channels if item.logging.channels is defined and item.logging.channels %}
channel {{ channel.name }} { channel {{ channel.name }} {
{% filter indent(bind9_config_indent, true) %} {% filter indent(bind9_config_indent, true) %}
{% if channel.file is defined and channel.file %} {% if channel.file is defined and channel.file %}
@@ -26,4 +25,3 @@ file "{{ channel.file.name }}"
}; };
{% endfor %} {% endfor %}
{% endfilter %}}; {% endfilter %}};
{% endmacro %}

View File

@@ -1,9 +1,7 @@
{% macro parental_agents(parental_agents) %} {% for agent in item.parental_agents if item.parental_agents is iterable %}
{% for agent in parental_agents if parental_agents is iterable %}
parental-agents {{ agent.name -}} parental-agents {{ agent.name -}}
{{ (' port ' + agent.port | string) if agent.port is defined and agent.port -}} {{ (' port ' + agent.port | string) if agent.port is defined and agent.port -}}
{{ (' dscp ' + agent.dscp | string) if agent.dscp is defined and agent.dscp }} { {{ (' dscp ' + agent.dscp | string) if agent.dscp is defined and agent.dscp }} {
{{ functions.list_address_port_key_tls(agent.addresses) -}}}; {{ functions.list_address_port_key_tls(agent.addresses) -}}};
{% endfor %} {% endfor %}
{% endmacro %}