Browse Source

Fix overwriting resolv conf and quote texts, add MX

master
Alex 2 years ago
parent
commit
33c4e6de98
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
  1. 7
      tasks/main.yml
  2. 6
      templates/redxen-dns.conf.j2
  3. 1
      templates/resolv.conf

7
tasks/main.yml

@ -12,10 +12,9 @@ @@ -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

6
templates/redxen-dns.conf.j2

@ -7,7 +7,7 @@ server: @@ -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: @@ -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

@ -0,0 +1 @@ @@ -0,0 +1 @@
nameserver 127.0.0.1