aboutsummaryrefslogtreecommitdiff
path: root/dns.yml
diff options
context:
space:
mode:
authorjaseg <code@jaseg.net>2020-12-29 13:08:13 +0100
committerjaseg <code@jaseg.net>2020-12-29 13:08:13 +0100
commitd1b0579a41c8215487a17317851f01756a1d938d (patch)
tree60d56112542ee5af43f73ad0e10dda9c0b3b1d09 /dns.yml
parente346c558ea3d9761d7affe796664e1574f33773a (diff)
downloadinfra-d1b0579a41c8215487a17317851f01756a1d938d.tar.gz
infra-d1b0579a41c8215487a17317851f01756a1d938d.tar.bz2
infra-d1b0579a41c8215487a17317851f01756a1d938d.zip
Add dns, dyndns services
Diffstat (limited to 'dns.yml')
-rw-r--r--dns.yml91
1 files changed, 91 insertions, 0 deletions
diff --git a/dns.yml b/dns.yml
new file mode 100644
index 0000000..0fd753a
--- /dev/null
+++ b/dns.yml
@@ -0,0 +1,91 @@
+- name: Setup subdomain A records pointing to wendelstein
+ inwx:
+ domain: "{{item.partition('.')[2]}}"
+ record: "{{item.partition('.')[0]}}"
+ type: A
+ value: "{{ hostvars['wendelstein']['ansible_default_ipv4']['address'] }}"
+ loop: "{{subdomains}}"
+
+- name: Setup dyndns A record
+ inwx:
+ domain: jaseg.de
+ record: ns
+ type: A
+ value: "{{ hostvars['wendelstein']['ansible_default_ipv4']['address'] }}"
+
+- name: Setup dyndns NS record
+ inwx:
+ domain: jaseg.de
+ record: dyn
+ type: NS
+ value: 'ns.jaseg.de'
+
+- name: Setup subdomain AAAA records pointing to wendelstein
+ inwx:
+ domain: "{{item.partition('.')[2]}}"
+ record: "{{item.partition('.')[0]}}"
+ type: AAAA
+ value: "{{ hostvars['wendelstein']['ansible_default_ipv6']['address'] }}"
+ loop: "{{subdomains}}"
+
+- name: Setup jaseg.net subdomain MX records pointing to fastmail
+ inwx:
+ domain: "{{item.partition('.')[2]}}"
+ record: "{{item.partition('.')[0]}}"
+ type: MX
+ priority: 10
+ value: in1-smtp.messagingengine.com
+ loop: "{{subdomains}}"
+
+- name: Setup jaseg.net subdomain MX records pointing to fastmail
+ inwx:
+ domain: "{{item.partition('.')[2]}}"
+ record: "{{item.partition('.')[0]}}"
+ type: MX
+ priority: 20
+ value: in2-smtp.messagingengine.com
+ loop: "{{subdomains}}"
+
+- name: Setup sendgrid gateway
+ inwx:
+ domain: jaseg.de
+ type: CNAME
+ record: "{{item.split(' ')[0]}}"
+ value: "{{item.split(' ')[1]}}"
+ loop:
+ - em6100.automation u14518136.wl137.sendgrid.net
+ - s1._domainkey.automation s1.domainkey.u14518136.wl137.sendgrid.net
+ - s2._domainkey.automation s2.domainkey.u14518136.wl137.sendgrid.net
+
+- name: Set fastmail DNS entry template
+ set_fact:
+ fastmail_dns_entries:
+ - {rtype: MX, record: ".", prio: 10, value: in1-smtp.messagingengine.com}
+ - {rtype: MX, record: ".", prio: 20, value: in2-smtp.messagingengine.com}
+ - {rtype: MX, record: "*", prio: 10, value: in1-smtp.messagingengine.com}
+ - {rtype: MX, record: "*", prio: 20, value: in2-smtp.messagingengine.com}
+ - {rtype: TXT, record: ".", value: "v=spf1 include:spf.messagingengine.com ?all"}
+ - {rtype: CNAME, record: mesmtp._domainkey, value: mesmtp.jaseg.de.dkim.fmhosted.com}
+ - {rtype: CNAME, record: fm1._domainkey, value: fm1.jaseg.de.dkim.fmhosted.com}
+ - {rtype: CNAME, record: fm2._domainkey, value: fm2.jaseg.de.dkim.fmhosted.com}
+ - {rtype: CNAME, record: fm3._domainkey, value: fm3.jaseg.de.dkim.fmhosted.com}
+ - {rtype: SRV, record: _submission._tcp, prio: 0, weight: 1, port: 587, value: smtp.fastmail.com}
+ - {rtype: SRV, record: _imap._tcp, prio: 0, weight: 0, port: 0, value: "."}
+ - {rtype: SRV, record: _imaps._tcp, prio: 0, weight: 1, port: 993, value: imap.fastmail.com}
+ - {rtype: SRV, record: _pop3._tcp, prio: 0, weight: 0, port: 0, value: "."}
+ - {rtype: SRV, record: _pop3s._tcp, prio: 10, weight: 1, port: 995, value: pop.fastmail.com}
+ - {rtype: SRV, record: _jmap._tcp, prio: 0, weight: 1, port: 443, value: jmap.fastmail.com}
+ - {rtype: SRV, record: _carddav._tcp, prio: 0, weight: 0, port: 0, value: "."}
+ - {rtype: SRV, record: _carddavs._tcp, prio: 0, weight: 1, port: 443, value: carddav.fastmail.com}
+
+- name: Setup fastmail DNS entries
+ inwx:
+ domain: "{{ item[1] }}"
+ type: "{{ item[0]['rtype'] }}"
+ record: "{{ item[0]['record'] | regex_replace('\\.*$', '') }}"
+ priority: "{{ item[0].get('prio') | int }}"
+ port: "{{ item[0].get('port') | int}}"
+ weight: "{{ item[0].get('weight') | int }}"
+ value: "{{ item[0]['value'] }}"
+ loop: "{{ fastmail_dns_entries | product(fastmail_domains) | list }}"
+