From 9b6c9e7e34692ba4f5fba2b4006e686b8807da7c Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Mon, 14 Jul 2025 17:43:03 +0200 Subject: [PATCH] feat: set default record type to A --- defaults/main.yaml | 1 - templates/unbound/zones.conf.j2 | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/defaults/main.yaml b/defaults/main.yaml index 7cb4d99..f08b22e 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -19,5 +19,4 @@ unbound_zones: records: - name: "server.example.internal" - type: "A" value: "192.168.1.0" diff --git a/templates/unbound/zones.conf.j2 b/templates/unbound/zones.conf.j2 index d0ecb0a..065c859 100644 --- a/templates/unbound/zones.conf.j2 +++ b/templates/unbound/zones.conf.j2 @@ -13,7 +13,7 @@ server: {% elif record.type == 'PTR' %} local-data: "{{ record.name }}. IN PTR {{ record.value }}" {% else %} - local-data: "{{ record.name }}. IN {{ record.type }} {{ record.value }}" + local-data: "{{ record.name }}. IN {{ record.type | default('A') }} {{ record.value }}" {% endif %} {% endfor %}