From 6bf441c9d4be2da1938f217aead490cf2e3bda65 Mon Sep 17 00:00:00 2001 From: Romina Brown Date: Mon, 27 Apr 2026 14:08:59 -0300 Subject: [PATCH 1/3] systmed-resolved configuration to avoid conflicts with zimbra-dnscache --- tasks/configure/dnscache.yml | 28 ++++++++++++++++++++++++++++ tasks/main.yml | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 tasks/configure/dnscache.yml diff --git a/tasks/configure/dnscache.yml b/tasks/configure/dnscache.yml new file mode 100644 index 0000000..55e0211 --- /dev/null +++ b/tasks/configure/dnscache.yml @@ -0,0 +1,28 @@ +--- + +- name: Deshabilitar resolvedor local + ansible.builtin.ini_file: + path: /etc/systemd/resolved.conf + section: Resolve + option: DNSStubListener + value: "no" + register: disable_dns_stub_listener + +- name: Destruir enlace simbólico + file: + path: /etc/resolv.conf + state: absent + when: disable_dns_stub_listener.changed + +- name: Crear enlace simbólico + file: + path: /etc/resolv.conf + src: /run/systemd/resolve/resolv.conf + state: link + when: disable_dns_stub_listener.changed + +- name: Reiniciar servicio systemd-resolved + ansible.builtin.service: + name: systemd-resolved + state: restarted + when: disable_dns_stub_listener.changed \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index 2def1c9..33ee889 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,6 +28,8 @@ when: zimbra_store == 'y' - import_tasks: 'configure/mta.yml' when: zimbra_mta == 'y' +- import_tasks: 'configure/dnscache.yml' + when: zimbra_dnscache == 'y' # # Extras configuration process From 79a1888832735d5940e52bbbe5516fff3f95ce3c Mon Sep 17 00:00:00 2001 From: Romina Brown Date: Mon, 4 May 2026 16:31:35 -0300 Subject: [PATCH 2/3] Adding disable_existing_dns_stub_listener variable --- defaults/main.yml | 1 + ...nscache.yml => disable_existing_dns_stub_listener.yml} | 8 ++++---- tasks/main.yml | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) rename tasks/configure/{dnscache.yml => disable_existing_dns_stub_listener.yml} (71%) diff --git a/defaults/main.yml b/defaults/main.yml index 7d9d629..2d8673c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -45,3 +45,4 @@ timezone: UTC ################################################################################ zimbra_version: 8.8.15 +disable_existing_dns_stub_listener: n \ No newline at end of file diff --git a/tasks/configure/dnscache.yml b/tasks/configure/disable_existing_dns_stub_listener.yml similarity index 71% rename from tasks/configure/dnscache.yml rename to tasks/configure/disable_existing_dns_stub_listener.yml index 55e0211..7376646 100644 --- a/tasks/configure/dnscache.yml +++ b/tasks/configure/disable_existing_dns_stub_listener.yml @@ -1,6 +1,6 @@ --- -- name: Deshabilitar resolvedor local +- name: Disable local resolver ansible.builtin.ini_file: path: /etc/systemd/resolved.conf section: Resolve @@ -8,20 +8,20 @@ value: "no" register: disable_dns_stub_listener -- name: Destruir enlace simbólico +- name: Delete symbolic link file: path: /etc/resolv.conf state: absent when: disable_dns_stub_listener.changed -- name: Crear enlace simbólico +- name: Create symbolic link file: path: /etc/resolv.conf src: /run/systemd/resolve/resolv.conf state: link when: disable_dns_stub_listener.changed -- name: Reiniciar servicio systemd-resolved +- name: Restart systemd-resolved service ansible.builtin.service: name: systemd-resolved state: restarted diff --git a/tasks/main.yml b/tasks/main.yml index 33ee889..862fb26 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -28,8 +28,8 @@ when: zimbra_store == 'y' - import_tasks: 'configure/mta.yml' when: zimbra_mta == 'y' -- import_tasks: 'configure/dnscache.yml' - when: zimbra_dnscache == 'y' +- import_tasks: 'configure/disable_existing_dns_stub_listener.yml' + when: zimbra_dnscache == 'y' and disable_existing_dns_stub_listener == 'y' # # Extras configuration process From 93cee926303bb6bd7b05902018a146b483ab5b12 Mon Sep 17 00:00:00 2001 From: Romina Brown Date: Wed, 6 May 2026 18:51:31 -0300 Subject: [PATCH 3/3] Modifying README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 9091196..8bae007 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Role Variables * **zmlogoapp:** Inform the path for your logo (Application Screen) - don't inform and no image will be applied; * **timezone:** inform the timezone the playbook should set in your server; * **zimbra_version:** Inform which version of Zimbra you want to install. Default: 8.8.15 +* **disable_existing_dns_stub_listener:** Inform "y" to disable the systemd-resolved DNS stub listener and free up port 53. Default: **n** Service Variables - Inform "y" or "n" --------------