Fix overwriting resolv conf and quote texts, add MX

This commit is contained in:
Alex 2020-08-09 11:55:57 +02:00
parent 8e2f773811
commit 33c4e6de98
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
3 changed files with 7 additions and 7 deletions

View File

@ -12,10 +12,9 @@
- unbound
- config
- name: Set unbound as default dns
replace:
path: /etc/resolv.conf
regexp: "^nameserver.*$"
replace: "nameserver 127.0.0.1"
template:
src: 'resolv.conf'
dest: /etc/resolv.conf
tags:
- unbound
- config

View File

@ -7,7 +7,7 @@ server:
local-data: "redxen.eu. IN SOA n0.redxen.eu admin.redxen.eu 2020053102 1800 120 604800 3600"
{% for record in unbound.public.TXT %}
local-data: "{{ record.name }}redxen.eu. 86400 IN TXT {{ record.content }}"
local-data: '{{ record.name }}redxen.eu. 86400 IN TXT "{{ record.content }}" {% if record.content2|default(false) %}"{{ record.content2 }}"{% endif %}'
{% endfor %}
{% for record in unbound.public.CNAME %}
@ -18,8 +18,8 @@ server:
local-data: "_{{ record.service }}._{{ record.proto }}.redxen.eu. 86400 IN SRV 0 5 {{ record.port }} {{ record.host }}."
{% endfor %}
{% for record in unbound.public.A %}
local-data: "{{ record.name }}redxen.eu. 86400 IN A {{ record.addr }}"
{% for record in unbound.public.MX %}
local-data: "{{ record.name }}redxen.eu. 86400 IN MX {{ record.priority|default(10) }} {{ record.host }}"
{% endfor %}
{% for domains in unbound.public.group.A %}

1
templates/resolv.conf Normal file
View File

@ -0,0 +1 @@
nameserver 127.0.0.1