From 6216bbbbf164ddacf64cd5376222a0da60d1d589 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Mon, 14 Jul 2025 15:37:00 +0200 Subject: [PATCH] feat: improve unbound config location --- tasks/config.yaml | 15 ++++++++++++--- templates/unbound/unbound.conf.j2 | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tasks/config.yaml b/tasks/config.yaml index eb9bb47..dc84ed3 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -3,10 +3,19 @@ # configure unbound - name: "config - unbound" ansible.builtin.template: - src: "{{ item }}" - dest: "/etc/unbound/unbound.conf.d/" + src: "templates/unbound/unbound.conf.j2" + dest: "/etc/unbound/unbound.conf" + owner: "root" + group: "root" + mode: "0644" + notify: "restart unbound" + +# configure unbound zones +- name: "config - unbound zones" + ansible.builtin.template: + src: "templates/unbound/zones.conf.j2" + dest: "/etc/unbound/zones.conf" owner: "root" group: "root" mode: "0644" - with_fileglob: "templates/unbound/*.j2" notify: "restart unbound" diff --git a/templates/unbound/unbound.conf.j2 b/templates/unbound/unbound.conf.j2 index d276fab..6451455 100644 --- a/templates/unbound/unbound.conf.j2 +++ b/templates/unbound/unbound.conf.j2 @@ -30,7 +30,7 @@ server: use-caps-for-id: no # include zone configurations - include: "/etc/unbound/conf.d/*.conf" + include: "/etc/unbound/zones.conf" # forward zones configuration forward-zone: