Correction for DNSDist(DoH DoT) service

This commit is contained in:
2023-05-25 05:52:18 +02:00
parent 9bf5f2dab4
commit 105ee89080
3 changed files with 32 additions and 17 deletions

View File

@@ -38,20 +38,20 @@
path: /etc/dnsdist/dnsdist.conf
regexp: '__SSL_CRT__'
replace: '/etc/ssl/{{ domain}}.crt'
when: installCertbot == false
when: installCertbot == False
- name: Add SSL keys to dnsdist.conf
ansible.builtin.replace:
path: /etc/dnsdist/dnsdist.conf
regexp: '__SSL_KEY__'
replace: '/etc/ssl/{{ domain}}.key'
when: installCertbot == false
when: installCertbot == False
- name: permission to ssl cert
shell: |
setfacl -R -m u:_dnsdist:rx /etc/ssl/"{{ domain }}".key
setfacl -R -m u:_dnsdist:rx /etc/ssl/"{{ domain }}".crt
when: installCertbot == false
when: installCertbot == False
@@ -59,23 +59,30 @@
ansible.builtin.replace:
path: /etc/dnsdist/dnsdist.conf
regexp: '__SSL_CRT__'
replace: '/etc/letsencrypt/{{ domain}}/fullchain.pem'
when: installCertbot == true
replace: '/etc/letsencrypt/live/{{ domain}}/fullchain.pem'
when: installCertbot == True
- name: Add SSL keys to dnsdist.conf
ansible.builtin.replace:
path: /etc/dnsdist/dnsdist.conf
regexp: '__SSL_KEY__'
replace: '/etc/letsencrypt/{{ domain}}/privkey.pem'
when: installCertbot == true
replace: '/etc/letsencrypt/live/{{ domain}}/privkey.pem'
when: installCertbot == True
- name: Set permission letsencrypt SSL keys
shell: setfacl -R -m u:_dnsdist:rx /etc/letsencrypt/
when: installCertbot == true
when: installCertbot == True
- name: Disable and stop systemd-resolved
shell: |
systemctl disable systemd-resolved
systemctl stop systemd-resolved || echo "systemd-resolved is already stopped"
- name: Start dnsdist service
shell: "systemctl start dnsdist"
- name: Enable systemd service
shell: "systemctl enable dnsdist"