free the port 53 for nginx

This commit is contained in:
Jean-Marie Mineau 2021-01-23 13:45:25 +01:00
parent 7208a8ccbd
commit a6b9447b87
4 changed files with 30 additions and 0 deletions

View file

@ -5,4 +5,5 @@
- hosts: proxy
roles:
- install_nginx
- configure_resolved
- reverse_proxy_stream

View file

@ -1,3 +1,4 @@
---
# Use python 3
ansible_python_interpreter: /usr/bin/python3
dns_resolve_server: 1.1.1.1

View file

@ -0,0 +1,5 @@
---
- name: Reload systemd-resolve
systemd:
name: systemd-resolved
state: restart

View file

@ -0,0 +1,23 @@
---
- name: Change the DNS server
lineinfile:
path: /etc/systemd/resolved.conf
insertafter: '[Resolve]'
regexp: '^#?DNS='
line: "DNS={{ dns_resolve_server }}"
notify: Reload systemd-resolve
- name: Remove the stub listener
lineinfile:
path: /etc/systemd/resolved.conf
insertafter: '[Resolve]'
regexp: '^#?DNSStubListener='
line: "DNSStubListener=no"
notify: Reload systemd-resolve
- name: Link resolve conf
file:
src: /run/systemd/resolve/resolv.conf
dest: /etc/resolv.conf
state: link
force: yes