From e538644617fc56b8629cd709782f1e61ddb361cb Mon Sep 17 00:00:00 2001 From: Daniel Akulenok Date: Wed, 15 May 2024 11:04:46 +0200 Subject: [PATCH] Spacing --- templates/named.conf.acl.j2 | 1 + templates/named.conf.controls.j2 | 1 + templates/named.conf.dlz.j2 | 1 + templates/named.conf.dnssec-policy.j2 | 1 + templates/named.conf.dyndb.j2 | 1 + templates/named.conf.generator.j2 | 5 ----- templates/named.conf.http.j2 | 1 + templates/named.conf.include.j2 | 1 + templates/named.conf.key.j2 | 1 + templates/named.conf.logging.j2 | 1 + templates/named.conf.options.j2 | 5 +++++ templates/named.conf.parental-agents.j2 | 1 + templates/named.conf.primaries.j2 | 1 + templates/named.conf.server.j2 | 1 + templates/named.conf.statistics-channels.j2 | 1 + templates/named.conf.tls.j2 | 1 + templates/named.conf.trust-anchors.j2 | 1 + templates/named.conf.view.j2 | 1 + templates/named.conf.zone.j2 | 2 +- 19 files changed, 22 insertions(+), 6 deletions(-) diff --git a/templates/named.conf.acl.j2 b/templates/named.conf.acl.j2 index 89e454a..6e26a94 100644 --- a/templates/named.conf.acl.j2 +++ b/templates/named.conf.acl.j2 @@ -1,5 +1,6 @@ {# ACL Macro. Very easy statement. It's just a list of address match elements. #} {% for acl in item.acl %} + acl {{ acl.name }} { {{ functions.simple_item_list(acl.addresses) -}} }; diff --git a/templates/named.conf.controls.j2 b/templates/named.conf.controls.j2 index f36080e..6d88280 100644 --- a/templates/named.conf.controls.j2 +++ b/templates/named.conf.controls.j2 @@ -1,3 +1,4 @@ + controls { {% filter indent(bind9_config_indent, true) %} {% for control in item.controls %} diff --git a/templates/named.conf.dlz.j2 b/templates/named.conf.dlz.j2 index 3d89dd5..e614a8b 100644 --- a/templates/named.conf.dlz.j2 +++ b/templates/named.conf.dlz.j2 @@ -1,4 +1,5 @@ {% 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) + '";') }} diff --git a/templates/named.conf.dnssec-policy.j2 b/templates/named.conf.dnssec-policy.j2 index d94867b..6eca922 100644 --- a/templates/named.conf.dnssec-policy.j2 +++ b/templates/named.conf.dnssec-policy.j2 @@ -1,4 +1,5 @@ {% for policy in item.dnssec_policy if item.dnssec_policy is iterable %} + dnssec-policy "{{ policy.name }}" { {% filter indent(bind9_config_indent, true) %} {% if policy.keys is defined and policy.keys %} diff --git a/templates/named.conf.dyndb.j2 b/templates/named.conf.dyndb.j2 index 822ec52..816725f 100644 --- a/templates/named.conf.dyndb.j2 +++ b/templates/named.conf.dyndb.j2 @@ -1,4 +1,5 @@ {% for dyndb in item.dyndb if item.dyndb is iterable %} + dyndb {{ dyndb.name }} "{{ dyndb.driver }}" { {% filter indent(bind9_config_indent, true) %} {{ functions.simple_item_list(dyndb.parameters) -}} diff --git a/templates/named.conf.generator.j2 b/templates/named.conf.generator.j2 index e7d4598..ba4e518 100644 --- a/templates/named.conf.generator.j2 +++ b/templates/named.conf.generator.j2 @@ -1,12 +1,7 @@ {% import 'named.conf.functions.j2' as functions with context %} {{ ansible_managed | comment }} {% if item.options is defined and item.options %} -options { -{% filter indent(bind9_config_indent,true)%} {% include 'named.conf.options.j2' %} -{% endfilter %} -}; - {% endif %} {% if item.acl is defined and item.acl %} {% include 'named.conf.acl.j2' %} diff --git a/templates/named.conf.http.j2 b/templates/named.conf.http.j2 index 6007008..c2b9c51 100644 --- a/templates/named.conf.http.j2 +++ b/templates/named.conf.http.j2 @@ -1,4 +1,5 @@ {% for http in item.http if item.http is iterable %} + http {{ http.name }} { {% filter indent(bind9_config_indent, true) %} {% if http.endpoints is defined and http.endpoints %} diff --git a/templates/named.conf.include.j2 b/templates/named.conf.include.j2 index 9652ed6..749fd05 100644 --- a/templates/named.conf.include.j2 +++ b/templates/named.conf.include.j2 @@ -1,3 +1,4 @@ + {% for file in item.include %} include "{{ file }}"; {% endfor %} diff --git a/templates/named.conf.key.j2 b/templates/named.conf.key.j2 index 70f621f..66da7cd 100644 --- a/templates/named.conf.key.j2 +++ b/templates/named.conf.key.j2 @@ -1,4 +1,5 @@ {% for keyname in item.keylist if item.keylist is iterable %} + key {{ keyname.name }} { {% filter indent(bind9_config_indent, true) %} {{ ('algorithm ' + keyname.algorithm + ';\n') if keyname.algorithm is defined and keyname.algorithm -}} diff --git a/templates/named.conf.logging.j2 b/templates/named.conf.logging.j2 index 19f3814..0280629 100644 --- a/templates/named.conf.logging.j2 +++ b/templates/named.conf.logging.j2 @@ -1,3 +1,4 @@ + logging { {% filter indent(bind9_config_indent, true) %} {% for category in item.logging.categories if item.logging.categories is defined and item.logging.categories %} diff --git a/templates/named.conf.options.j2 b/templates/named.conf.options.j2 index 706f136..d1e5525 100644 --- a/templates/named.conf.options.j2 +++ b/templates/named.conf.options.j2 @@ -1,3 +1,6 @@ + +options { +{% filter indent(bind9_config_indent,true)%} {# Unicorn Options#} {% if item.options.rrset_order is defined and item.options.rrset_order %} rrset-order { @@ -460,3 +463,5 @@ tkey-dhkey "{{ item.options.tkey_dhkey.key_name }}" {{ item.options.tkey_dhkey.k {{ (functions.boolean_option('use-alt-transfer-source', item.options.use_alt_transfer_source) + '\n') if item.options.use_alt_transfer_source is defined -}} {{ (functions.boolean_option('zero-no-soa-ttl', item.options.zero_no_soa_ttl) + '\n') if item.options.zero_no_soa_ttl is defined -}} {{ (functions.boolean_option('zero-no-soa-ttl-cache', item.options.zero_no_soa_ttl_cache) + '\n') if item.options.zero_no_soa_ttl_cache is defined -}} +{% endfilter %} +}; \ No newline at end of file diff --git a/templates/named.conf.parental-agents.j2 b/templates/named.conf.parental-agents.j2 index e191901..1c568c6 100644 --- a/templates/named.conf.parental-agents.j2 +++ b/templates/named.conf.parental-agents.j2 @@ -1,4 +1,5 @@ {% for agent in item.parental_agents if item.parental_agents is iterable %} + parental-agents {{ agent.name -}} {{ (' port ' + agent.port | string) if agent.port is defined and agent.port -}} {{ (' dscp ' + agent.dscp | string) if agent.dscp is defined and agent.dscp }} { diff --git a/templates/named.conf.primaries.j2 b/templates/named.conf.primaries.j2 index dfe93e2..bbeb3d2 100644 --- a/templates/named.conf.primaries.j2 +++ b/templates/named.conf.primaries.j2 @@ -1,4 +1,5 @@ {% for primary in item.primaries if item.primaries is iterable %} + primaries {{ primary.name -}} {{ (' port ' + primary.port | string) if primary.port is defined and primary.port -}} {{ (' dscp ' + primary.dscp | string) if primary.dscp is defined and primary.dscp }} { diff --git a/templates/named.conf.server.j2 b/templates/named.conf.server.j2 index aba7d46..77786f4 100644 --- a/templates/named.conf.server.j2 +++ b/templates/named.conf.server.j2 @@ -1,4 +1,5 @@ {% for server in item.server if item.server is iterable %} + server {{ server.prefix }} { {% filter indent(bind9_config_indent, true) %} {% if server.transfer_source is defined and server.transfer_source is mapping %} diff --git a/templates/named.conf.statistics-channels.j2 b/templates/named.conf.statistics-channels.j2 index a52d26c..f563342 100644 --- a/templates/named.conf.statistics-channels.j2 +++ b/templates/named.conf.statistics-channels.j2 @@ -1,3 +1,4 @@ + statistics-channels { {% filter indent(bind9_config_indent, true) %} {% for channel in item.statistics_channels if item.statistics_channels is iterable %} diff --git a/templates/named.conf.tls.j2 b/templates/named.conf.tls.j2 index 63cf816..3fbcc73 100644 --- a/templates/named.conf.tls.j2 +++ b/templates/named.conf.tls.j2 @@ -1,4 +1,5 @@ {% 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 -}} diff --git a/templates/named.conf.trust-anchors.j2 b/templates/named.conf.trust-anchors.j2 index b4669ac..ff55dcc 100644 --- a/templates/named.conf.trust-anchors.j2 +++ b/templates/named.conf.trust-anchors.j2 @@ -1,3 +1,4 @@ + trust-anchors { {% filter indent(bind9_config_indent, true) %} {% for anchor in item.trust_anchors if item.trust_anchors is iterable %} diff --git a/templates/named.conf.view.j2 b/templates/named.conf.view.j2 index c1832a6..56b2297 100644 --- a/templates/named.conf.view.j2 +++ b/templates/named.conf.view.j2 @@ -1,4 +1,5 @@ {% for view in item.view if item.view is iterable %} + view {{ view.name }} { {% filter indent(bind9_config_indent, true) %} {{ ('match-recursive-only ' + functions.named_boolean(view.match_recursive_only) + ';\n') if view.match_recursive_only is defined -}} diff --git a/templates/named.conf.zone.j2 b/templates/named.conf.zone.j2 index 1d3f298..0423220 100644 --- a/templates/named.conf.zone.j2 +++ b/templates/named.conf.zone.j2 @@ -1,4 +1,5 @@ {% for zone in item.zones %} + zone "{{ zone.name }}" { {% filter indent(bind9_config_indent, true) %} # Zone {{ zone.name }} type {{ zone.type }} @@ -155,5 +156,4 @@ parental-source-v6 {{ zone.parental_source_v6.address -}} {{ ('in-view ' + zone.in_view | string+';\n') if zone.in_view is defined and zone.in_view -}} {% endfilter %} }; - {% endfor %}