]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Include controls.conf as jinja2 template
authorNicki Křížek <nicki@isc.org>
Wed, 1 Apr 2026 16:25:28 +0000 (18:25 +0200)
committerNicki Křížek <nicki@isc.org>
Wed, 27 May 2026 14:25:43 +0000 (16:25 +0200)
Rather than using named.conf include, render the controls directly into
the config using jinja2 template include.

40 files changed:
bin/tests/system/_common/controls.conf.in [deleted file]
bin/tests/system/_common/controls.conf.j2 [new file with mode: 0644]
bin/tests/system/allow_query/.gitignore
bin/tests/system/allow_query/ns2/controls.conf.j2 [deleted symlink]
bin/tests/system/allow_query/ns2/named.conf.j2
bin/tests/system/allow_query/ns2/named02.conf.j2
bin/tests/system/allow_query/ns2/named03.conf.j2
bin/tests/system/allow_query/ns2/named04.conf.j2
bin/tests/system/allow_query/ns2/named05.conf.j2
bin/tests/system/allow_query/ns2/named06.conf.j2
bin/tests/system/allow_query/ns2/named07.conf.j2
bin/tests/system/allow_query/ns2/named08.conf.j2
bin/tests/system/allow_query/ns2/named09.conf.j2
bin/tests/system/allow_query/ns2/named10.conf.j2
bin/tests/system/allow_query/ns2/named11.conf.j2
bin/tests/system/allow_query/ns2/named12.conf.j2
bin/tests/system/allow_query/ns2/named21.conf.j2
bin/tests/system/allow_query/ns2/named22.conf.j2
bin/tests/system/allow_query/ns2/named23.conf.j2
bin/tests/system/allow_query/ns2/named24.conf.j2
bin/tests/system/allow_query/ns2/named25.conf.j2
bin/tests/system/allow_query/ns2/named26.conf.j2
bin/tests/system/allow_query/ns2/named27.conf.j2
bin/tests/system/allow_query/ns2/named28.conf.j2
bin/tests/system/allow_query/ns2/named29.conf.j2
bin/tests/system/allow_query/ns2/named30.conf.j2
bin/tests/system/allow_query/ns2/named31.conf.j2
bin/tests/system/allow_query/ns2/named32.conf.j2
bin/tests/system/allow_query/ns2/named33.conf.j2
bin/tests/system/allow_query/ns2/named34.conf.j2
bin/tests/system/allow_query/ns2/named40.conf.j2
bin/tests/system/allow_query/ns2/named53.conf.j2
bin/tests/system/allow_query/ns2/named54.conf.j2
bin/tests/system/allow_query/ns2/named55.conf.j2
bin/tests/system/allow_query/ns2/named56.conf.j2
bin/tests/system/allow_query/ns2/named57.conf.j2
bin/tests/system/allow_query/tests_sh_allow_query.py
bin/tests/system/optout/ns2/controls.conf.j2 [deleted symlink]
bin/tests/system/optout/ns2/named.conf.j2
bin/tests/system/optout/tests_optout.py

diff --git a/bin/tests/system/_common/controls.conf.in b/bin/tests/system/_common/controls.conf.in
deleted file mode 100644 (file)
index 429a2d3..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-key rndc_key {
-       secret "1234abcd8765";
-       algorithm @DEFAULT_HMAC@;
-};
-
-controls {
-       inet 10.53.0.2 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
-};
-
diff --git a/bin/tests/system/_common/controls.conf.j2 b/bin/tests/system/_common/controls.conf.j2
new file mode 100644 (file)
index 0000000..975299f
--- /dev/null
@@ -0,0 +1,4 @@
+{% include "_common/rndc.key" %}
+controls {
+       inet @ns.ip@ port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
index f9285974439dbf96a2c12f05e9f1f85c2b6d2241..f40b21b45f1440c6f2131fce9009930c09a44116 100644 (file)
@@ -1,2 +1 @@
 /ns2/named.conf
-/ns2/controls.conf
diff --git a/bin/tests/system/allow_query/ns2/controls.conf.j2 b/bin/tests/system/allow_query/ns2/controls.conf.j2
deleted file mode 120000 (symlink)
index f1371a0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../_common/controls.conf.in
\ No newline at end of file
index 4f715dd77686092af65592c49bbe008fe7c5bb46..0777766fddda0505fa10c2a29ccf5ee67481d0e0 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 374b9c786fe61657add83d1126582274bf918740..524cb1c0821bf19f52c0540fd2f9563355488b8b 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 736c0a3c6cc3ea36be3b22833bb41d8803dd5c9a..e3f1f8aceb25a41fd09c4c8ad9065840e0b01a25 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index c740e7dc15b8b28e2e812ba4d7728e88514b7cf2..51ee80baaf547cf28bcec5d598ef6a480c202601 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index ae71b8bdfc52706c728c8d4240bbf1feee748d74..d7ea3c46d9d6950405427bb53e0635a5b039844e 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 534e8700ec1b2ac68e3e52241cc28253ce4e4cdb..4a2b29d7a2d15afcffaf230f92fbb862356a7703 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 0a2015721bde294153ed42b15ab08b10391ad707..75002889f4926c970dad145ba4e26b642ee7e0ce 100644 (file)
@@ -10,7 +10,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index ccf5ca88b08e8afee576918e8cd7e52d6d2e182b..7c3ffea4204ccb2edc2856a3dc13f61bc5681685 100644 (file)
@@ -10,7 +10,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 0abece84892f3d31dc497ee9a4e8b05cbc375602..d0ba3cfdba5f5e0ab20c8185d1bd1802b174bf2a 100644 (file)
@@ -10,7 +10,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index cb3922880ddad1d95e25b6970fd986d3838bc2d9..16f165eec0e97e9dbbadfeedb44f89729975e4a7 100644 (file)
@@ -13,7 +13,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 638deaa9c6cd9d5162cdfa495c81f69b23cff8a0..ef2b4a6aeb06b3ea8d787cd91571b5cb7c7e8720 100644 (file)
@@ -19,7 +19,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 64dfe10f6670b7905a08ac094601d7c526aa5d3f..23d8edd91ca8d89846846396783c98e107c6d04f 100644 (file)
@@ -13,7 +13,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index cff938b0063651d1441d7f118bddd6ea5d02eb17..a87bae281809c623b97e13d2b2223dc4a294b5dc 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 8c22336e6c0e919be3a4b7c743c8614b72aa618a..12f5ce20c41f94e50c22ff013cc360eb12839be6 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index e5d4ce55d7a8206251c29b128044e0327d2406ce..ed767421e31b1524a1f34189b4a31c3976dd7718 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 56603ec71729a883dda75dac2c4dbd30ee3733dc..67a4e312e57716ba8b61e3e7d4698fbb2ef84625 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 7b5e332ab85cc1c1d18a114657ffe7d142a07da4..bf4ca2e0a0ca0d7682d975d6ddae7a13161cfb6f 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 0c9c2f8f08281ff70c529eb20762cb1d21c152cb..5d60e312ca89311ca0123565d61a0fabc2a7c648 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 18aad0d39d07d614d84fce6ea9068401f1069be1..a25b35c8693014da17640d241315637f9422a8be 100644 (file)
@@ -9,7 +9,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 4b04b4274eb179362e477d506b86a049e048993f..b2749a63a84a11fdccbd4fc22a5f12eddf0b7f00 100644 (file)
@@ -9,7 +9,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index c4cdb3b0841f91d4fcb01de27559cc779eb45792..1b998d4b9e26a710fcc279ab9b0244b1d28b427c 100644 (file)
@@ -9,7 +9,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 773c4face4a6eeb2a7a5ae21be66d5fad28564f1..13707abb22e3c44054a3a55c5d58e96bf51fc9e8 100644 (file)
@@ -12,7 +12,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index bce1ad3cba1cbbbc33c95b9562afc2faef9e77aa..f8052031dc1c2aa85dd51575d2a4784d99f03df8 100644 (file)
@@ -19,7 +19,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index ad9d85ad0a12b64d30d5c34438b73708c643e471..a8e0b0c060fef481ca19308ce125025bd60cffd4 100644 (file)
@@ -12,7 +12,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 052320f91196dade1ea5e7c9bab31dfe2733c948..84f3933156ff5c5e16979b81f09524a6947ead96 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index c745aa68d8c2da59797d6ececd261c4466ddd710..703a575f34997bd9340102d877a13f8e3f4f081b 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 16b07370c69b3bfc38fdb27c036644fd4d47c4b3..f5ea753879290a38f182785d428dba7b13c5f9ec 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index b8fb4fb68bc37ffdedc07cae18d56068c79f408b..5e94448ed927b910baba58278350bc2c6425ea14 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index c50b55359916976d6491a4c17e6bb038d17e9d6c..24c3182c66d8b7a1818323321db0226e00d479c0 100644 (file)
@@ -8,7 +8,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 4d1087082d7c7e361c86905eda2345d73306b4ed..e5c34d982202bc001f17952620b05de05db2086a 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index a98fdd832fc41d1042ee68fd15b34f80787ec593..2e3fc9a14efd59c6f1acecccfccfefb264178c3f 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 5ba60146712c0f205a400057d722ba5d1baa993c..15985d9baae71c9d6e889fff6984b023c91003c0 100644 (file)
@@ -7,7 +7,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
        allow-query-on { any; };
index 0a17c7eea5fccf99b23d452948454b624b2a2925..bcc67ed23abde3e76a7d8cf10991aefed8ea2dbf 100644 (file)
@@ -14,7 +14,6 @@ import pytest
 pytestmark = pytest.mark.extra_artifacts(
     [
         "dig.out.*",
-        "ns2/controls.conf",
     ]
 )
 
diff --git a/bin/tests/system/optout/ns2/controls.conf.j2 b/bin/tests/system/optout/ns2/controls.conf.j2
deleted file mode 120000 (symlink)
index f1371a0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../_common/controls.conf.in
\ No newline at end of file
index e0ed51ea59bc6d6eb69b60b94b67e66eee6c7e74..7e20723dff3fd815e397195d4992e19eea2142bd 100644 (file)
@@ -14,7 +14,7 @@ options {
        sig-signing-signatures 900;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 dnssec-policy "optout" {
        keys {
index ef157b3e9e4518e448c57c26c464284c0d7656c3..f7be26d6e908151af8265490fdffa224de2869cd 100755 (executable)
@@ -34,7 +34,6 @@ pytestmark = [
             "ns2/*.signed",
             "ns2/*.jnl",
             "ns2/*.jbk",
-            "ns2/controls.conf",
             "ns2/dsset-*",
             "ns2/K*",
         ]