From e475d2ce407dfe7745f92be8580ce495fffd9406 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Fri, 24 Oct 2025 21:58:35 +0200 Subject: [PATCH] feat: added alpine support --- handlers/main.yaml | 11 ++++++++++- readme.md | 1 + tasks/config.yaml | 10 +++++++--- tasks/install.yaml | 7 +++++++ 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/handlers/main.yaml b/handlers/main.yaml index 70a0408..aa5f4a6 100644 --- a/handlers/main.yaml +++ b/handlers/main.yaml @@ -1,9 +1,18 @@ --- # unbound -- name: "restart unbound" +- name: "restart unbound debian" ansible.builtin.systemd: name: "unbound.service" state: "restarted" daemon_reload: true enabled: true + when: ansible_os_family == "Debian" + listen: "restart unbound" + +- name: "restart unbound alpine" + ansible.builtin.service: + name: "unbound" + state: "restarted" + when: ansible_os_family == "Alpine" + listen: "restart unbound" diff --git a/readme.md b/readme.md index 2dd16e3..16f8706 100644 --- a/readme.md +++ b/readme.md @@ -6,6 +6,7 @@ This role configures an Unbound DNS server. | Operating System | Version | | --- | ----- | +| Alpine | 3.22 | | Debian | 12 | ## Tags diff --git a/tasks/config.yaml b/tasks/config.yaml index dc84ed3..a6c2d85 100644 --- a/tasks/config.yaml +++ b/tasks/config.yaml @@ -1,6 +1,6 @@ --- -# configure unbound +# confiure unbound - name: "config - unbound" ansible.builtin.template: src: "templates/unbound/unbound.conf.j2" @@ -8,7 +8,9 @@ owner: "root" group: "root" mode: "0644" - notify: "restart unbound" + notify: + - "restart unbound debian" + - "restart unbound alpine" # configure unbound zones - name: "config - unbound zones" @@ -18,4 +20,6 @@ owner: "root" group: "root" mode: "0644" - notify: "restart unbound" + notify: + - "restart unbound debian" + - "restart unbound alpine" diff --git a/tasks/install.yaml b/tasks/install.yaml index 945089f..4f87c3d 100644 --- a/tasks/install.yaml +++ b/tasks/install.yaml @@ -6,3 +6,10 @@ name: "unbound" cache_valid_time: 120 when: 'ansible_os_family == "Debian"' + +# install unbound +- name: "install unbound" + community.general.apk: + name: "unbound" + update_cache: true + when: 'ansible_os_family == "Alpine"'