From cc51282a636c9e92688c1b757896a80a427af4d3 Mon Sep 17 00:00:00 2001
From: Alexandre Iooss <erdnaxe@crans.org>
Date: Mon, 27 Apr 2020 15:17:31 +0200
Subject: [PATCH] [bind] Add wildcart to .eu and .fr

---
 .../templates/bind/named.conf.local.j2        | 44 +++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/roles/bind-authoritative/templates/bind/named.conf.local.j2 b/roles/bind-authoritative/templates/bind/named.conf.local.j2
index c5c2b89b..9752be76 100644
--- a/roles/bind-authoritative/templates/bind/named.conf.local.j2
+++ b/roles/bind-authoritative/templates/bind/named.conf.local.j2
@@ -35,6 +35,50 @@ zone "_acme-challenge.crans.org" {
 	file "bak._acme-challenge.crans.org";
 };
 
+zone "_acme-challenge.crans.fr" {
+{% if is_master %}
+	type master;
+	notify yes;
+	update-policy {
+		grant certbot_challenge. name _acme-challenge.crans.fr. txt;
+	};
+{% else %}
+	type slave;
+	masters {
+{% for ip in masters_ipv4 %}
+		{{ ip }};
+{% endfor -%}
+{% for ip in masters_ipv6 %}
+		{{ ip }};
+{% endfor %}
+	};
+	notify no;
+{% endif %}
+	file "bak._acme-challenge.crans.fr";
+};
+
+zone "_acme-challenge.crans.eu" {
+{% if is_master %}
+	type master;
+	notify yes;
+	update-policy {
+		grant certbot_challenge. name _acme-challenge.crans.eu. txt;
+	};
+{% else %}
+	type slave;
+	masters {
+{% for ip in masters_ipv4 %}
+		{{ ip }};
+{% endfor -%}
+{% for ip in masters_ipv6 %}
+		{{ ip }};
+{% endfor %}
+	};
+	notify no;
+{% endif %}
+	file "bak._acme-challenge.crans.eu";
+};
+
 // Crans zones
 {% for zone in bind.zones|sort %}
 zone "{{ zone }}" {