]> 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>
Thu, 28 May 2026 09:36:55 +0000 (11:36 +0200)
Rather than using named.conf include, render the controls directly into
the config using jinja2 template include.

(cherry picked from commit f4ca352bc88ab1c766fb4862de118e494fddfb5b)

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 fec3ddd66f4df7d587f2d3a794af4a406900288c..74ce1291dd674904f11aae550df3c51c08adaf94 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 95a78b2ff05160a86d1f7702c90549e4306cca27..4d999000d43f4fdaa4b5c488333be0398cf0302d 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index fd6add2b19f7762702915c4d2b36f466c6b0107b..d1265a2e933832c8b2b5176df1e235c75f1b1769 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index f6d231dc6af717e3ea2d4693ac277a57218ce596..c6e9c4c7e849c944d7b96d2fc2dfe709bfb970a7 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index fe6cc0c6c0d92055594e423643f8cd318ed39930..535ff1a5d242d4050b04b8a93fefed2765bf3ee7 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 1f78f131ce344dfc01679d16e4c067926ff3e0d6..958eaac888c5f871b239482147f766d6015c3de2 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 15dca8f10148a741cfe46edae2e771dda82da63b..9e9d871267ec37497b2e7aed356330ccd2774c45 100644 (file)
@@ -23,7 +23,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index c2eed2dbf2f691c5841f716ca5329cd49c2208e9..ab59d75bec745a65c3e885dd31ab28c8fd82ac01 100644 (file)
@@ -23,7 +23,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 248da9e7bb3b3dd7b0975502a3c350af469725e9..88277e890950d75edcc9b516816195d9d0205631 100644 (file)
@@ -23,7 +23,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 1dbafbd7735f5c5b838f133b601febcf5038715b..0425b951cacb305e2f585b40ef8312aeeca76727 100644 (file)
@@ -26,7 +26,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 4d961a5776886c51fb8ad55348a1c78766214b61..62ba892898deff4ae2fa621644c71bf4f9233c65 100644 (file)
@@ -32,7 +32,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 75ab352676e4532c265735d82e9aa79db1363ff7..867d983655e2d6ccfbbf45f3c4721c457cd0e776 100644 (file)
@@ -26,7 +26,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index b120f2aaa5f9e21d2414ddbd1172125f8ab59cd6..173eff84bd74bb51e3c49d664b74898ae24b9ee8 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 37ccedcc8d89133529ae965d9f43f6f509893bc0..b589c0a538ec9c6738783e399413d0c3d9768124 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index c43e232f16c0de77b1ac70fc1671baf17f362b39..cca3f2b055bf7b2fdc28f5db48eeba884eacd0d1 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 6cdbeec18b800c63059749f7b33811e10d1f9caf..3441ca5ad9a11cbd675287a6cc2f60a1d2d6c13c 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 51e247ca92499cfbb92f1ed8f1096e214dff7da8..ecdc77cc3034c8affe812da96f76ecbc65ac35d6 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index a72136c8794a9f55058c9e61730035f3ed9a9218..5f20c6d62ab011d33ffa5baf6485725c441f1ac0 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 4c3f958d0b5e5f81223a848a6ff3cae395e13727..d1a414385e90557ac2ab27499208a8d97d5766e4 100644 (file)
@@ -22,7 +22,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 8db4555f8d99625c4a570deffcf3bc84246ca5aa..618643faadbaac759ef4b7cbbd5234d788a1dae8 100644 (file)
@@ -22,7 +22,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 2031a6ea515c98c7e11320762a5adc900036536d..67d2745f82c5e55ed6fc8a2b0abb7561f049be99 100644 (file)
@@ -22,7 +22,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 0a90219efa71013c5dc60803174b125e089da4b2..3e64bd36e8a772001248f4ea57678d6899bbb9d8 100644 (file)
@@ -25,7 +25,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index faec50e6a2a66e400872acb705a5efd9fe39a9aa..6636da1ddf12e77a2125d54555c8c2c94bf0cdbc 100644 (file)
@@ -32,7 +32,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index dcd663ba0a06652c168d4a00331d0c3d520a3b93..94ff36dac56c4f2d922dd4e8344a9f906af9e90c 100644 (file)
@@ -25,7 +25,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 3721e62f38604b4f9d3f78bd43806460fb87167f..e2b49900b722a2dbc4127a8974d0678426e0a8d9 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 09125ef021819afbe8c9b0a8268a62c17572f039..96d1f99207e98f9263b23b2475c98ef300847dc4 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 2349d9235796fdd04d2b85252494a31ed51fc33a..388de212ff72fd3d158ea141a40bf858d01d3687 100644 (file)
@@ -34,7 +34,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index d3463b27967c5cc55e0d59c242f99065a8dc8f0a..4a5f19fde14a60ee191c476ff5abfa2fa94b5511 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 5dddf8998eb95ff052b81fa8f2676c46faf68b21..57fc8f9f16eb9a6510eee89385bcea61255bff0b 100644 (file)
@@ -21,7 +21,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 zone "." {
        type hint;
index 4a0880fed3e0451ab48a0306ee2afa8b8558fbc6..8793c1e39acc141cd51c7a9c42f488a5b6ef0957 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index 564063b17ecb75cb1b80d392bbf221582eea0890..4f8c1d7fd5fd7e305a957e74067f2907e60a0147 100644 (file)
@@ -20,7 +20,7 @@ options {
        dnssec-validation no;
 };
 
-include "controls.conf";
+{% include "_common/controls.conf.j2" %}
 
 view "internal" {
 
index db5f3d0800650fab24ab153bb82643ab6868b8f3..6bb685b9a8eb2c968183723b43f02007d40248e1 100644 (file)
@@ -20,7 +20,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 6bfe881451e4a90a48eeb57e58f301bd1ede8fa5..ee069605f2e4df2b5392129587e0f6517eeb9531 100644 (file)
@@ -27,7 +27,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*",
         ]