add coturn service
This commit is contained in:
5
roles/dnsdist/files/cetbot-cron
Normal file
5
roles/dnsdist/files/cetbot-cron
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew; setfacl -R -m u:_dnsdist:rx /etc/letsencrypt/; systemctl restart dnsdist;
|
||||
@@ -85,4 +85,13 @@
|
||||
|
||||
|
||||
- name: Enable systemd service
|
||||
shell: "systemctl enable dnsdist"
|
||||
shell: "systemctl enable dnsdist"
|
||||
|
||||
- name: Copy cron certbot service
|
||||
ansible.builtin.copy:
|
||||
src: certbot-cron
|
||||
dest: /etc/cron.d/certbot
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
when: installCertbot == True
|
||||
|
||||
88
roles/dnsdist/tasks/main.yml~
Normal file
88
roles/dnsdist/tasks/main.yml~
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
- name: Install dnsdist
|
||||
apt:
|
||||
name:
|
||||
- dnsdist
|
||||
- acl
|
||||
state: present
|
||||
|
||||
- name: Allow DoT connexions
|
||||
ufw:
|
||||
rule: allow
|
||||
port: 853
|
||||
proto: tcp
|
||||
|
||||
- name: Allow DoH connexions
|
||||
ufw:
|
||||
rule: allow
|
||||
port: 443
|
||||
proto: tcp
|
||||
|
||||
- name: Allow DNS connexions
|
||||
ufw:
|
||||
rule: allow
|
||||
port: 53
|
||||
proto: any
|
||||
|
||||
- name: Copy Configuration file for DNSdist
|
||||
ansible.builtin.copy:
|
||||
src: dnsdist.conf
|
||||
dest: /etc/dnsdist/dnsdist.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
|
||||
- name: Add SSL keys to dnsdist.conf
|
||||
ansible.builtin.replace:
|
||||
path: /etc/dnsdist/dnsdist.conf
|
||||
regexp: '__SSL_CRT__'
|
||||
replace: '/etc/ssl/{{ domain}}.crt'
|
||||
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
|
||||
|
||||
- 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
|
||||
|
||||
|
||||
|
||||
- name: Add SSL keys to dnsdist.conf
|
||||
ansible.builtin.replace:
|
||||
path: /etc/dnsdist/dnsdist.conf
|
||||
regexp: '__SSL_CRT__'
|
||||
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/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
|
||||
|
||||
|
||||
- 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"
|
||||
Reference in New Issue
Block a user