diff --git a/README.md b/README.md index fb78f1d..ed3cd9c 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ zm_repo: 8: ... 9: ... ``` +* **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" -------------- diff --git a/defaults/main.yml b/defaults/main.yml index 1e33a38..f819fa1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -62,3 +62,4 @@ zm_repo: 6: zcs-8.8.15_GA_3869.RHEL6_64.20190918004220 7: zcs-8.8.15_GA_3869.RHEL7_64.20190918004220 8: zcs-8.8.15_GA_3953.RHEL8_64.20200629025823 +disable_existing_dns_stub_listener: n diff --git a/tasks/configure/disable_existing_dns_stub_listener.yml b/tasks/configure/disable_existing_dns_stub_listener.yml new file mode 100644 index 0000000..7376646 --- /dev/null +++ b/tasks/configure/disable_existing_dns_stub_listener.yml @@ -0,0 +1,28 @@ +--- + +- name: Disable local resolver + ansible.builtin.ini_file: + path: /etc/systemd/resolved.conf + section: Resolve + option: DNSStubListener + value: "no" + register: disable_dns_stub_listener + +- name: Delete symbolic link + file: + path: /etc/resolv.conf + state: absent + when: disable_dns_stub_listener.changed + +- name: Create symbolic link + file: + path: /etc/resolv.conf + src: /run/systemd/resolve/resolv.conf + state: link + when: disable_dns_stub_listener.changed + +- name: Restart systemd-resolved service + 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 1c501f9..f577fe9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -26,6 +26,8 @@ when: zimbra_store == 'y' - import_tasks: 'configure/mta.yml' when: zimbra_mta == 'y' +- import_tasks: 'configure/disable_existing_dns_stub_listener.yml' + when: zimbra_dnscache == 'y' and disable_existing_dns_stub_listener == 'y' # # Extras configuration process