free the port 53 for nginx
This commit is contained in:
parent
7208a8ccbd
commit
a6b9447b87
4 changed files with 30 additions and 0 deletions
1
dns.yml
1
dns.yml
|
@ -5,4 +5,5 @@
|
|||
- hosts: proxy
|
||||
roles:
|
||||
- install_nginx
|
||||
- configure_resolved
|
||||
- reverse_proxy_stream
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
# Use python 3
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
dns_resolve_server: 1.1.1.1
|
||||
|
|
5
roles/configure_resolved/handlers/main.yml
Normal file
5
roles/configure_resolved/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: Reload systemd-resolve
|
||||
systemd:
|
||||
name: systemd-resolved
|
||||
state: restart
|
23
roles/configure_resolved/tasks/main.yml
Normal file
23
roles/configure_resolved/tasks/main.yml
Normal 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
|
Loading…
Reference in a new issue