unwind: Initial version of role
This commit is contained in:
parent
e02e45c8a6
commit
9696f406ce
3 changed files with 30 additions and 0 deletions
5
roles/unwind/handlers/main.yml
Normal file
5
roles/unwind/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- name: Restart unwind
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: unwind
|
||||||
|
state: restarted
|
15
roles/unwind/tasks/main.yml
Normal file
15
roles/unwind/tasks/main.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
- name: Copy config
|
||||||
|
ansible.builtin.template:
|
||||||
|
dest: /etc/unwind.conf
|
||||||
|
src: unwind.conf.j2
|
||||||
|
mode: "0644"
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
notify: Restart unwind
|
||||||
|
|
||||||
|
- name: Enable service
|
||||||
|
ansible.builtin.service:
|
||||||
|
name: unwind
|
||||||
|
state: started
|
||||||
|
enabled: true
|
10
roles/unwind/templates/unwind.conf.j2
Normal file
10
roles/unwind/templates/unwind.conf.j2
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
{% if network_dns_servers is defined %}
|
||||||
|
forwarder {
|
||||||
|
{% for addr in network_dns_servers %}
|
||||||
|
{{ addr }} port 853 authentication name "{{ lookup('community.general.dig', addr + '/PTR')[:-1] }}" DoT
|
||||||
|
{% endfor %}
|
||||||
|
}
|
||||||
|
preference { DoT }
|
||||||
|
{% else %}
|
||||||
|
preference { oDoT-autoconf }
|
||||||
|
{% endif %}
|
Loading…
Add table
Reference in a new issue