- Caddyfile moves to config/ (directory mount) so 'caddy reload' sees the new file; the handler reloads gracefully instead of restarting - template validate: runs 'caddy validate' with the image Caddy uses - http:// catch-all aborts plain-HTTP requests for unknown hosts / bare IP; known hosts keep the automatic HTTPS redirect (tested) - read_header timeout 10s (default 1 min) - body_limit snippet: 1MB static sites, tinyauth, repaircafe; 10MB Pocket ID, Changedetection, ByteStash, Gotify, iGotify; 20MB Baikal - dns: remove grist, habits, office, podcasts, pdftools (nothing serves them) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
163 lines
5.4 KiB
YAML
163 lines
5.4 KiB
YAML
---
|
|
# dns.yml
|
|
- import_playbook: deploy-guard.yml
|
|
|
|
- name: Add A Records for thesatelliteoflove.com and nerder.land
|
|
hosts: localhost
|
|
gather_facts: false
|
|
|
|
# Scoped IAM user (Route53 only) so this doesn't depend on an `aws login` session
|
|
module_defaults:
|
|
amazon.aws.route53:
|
|
access_key: "{{ vault_aws_dns.access_key }}"
|
|
secret_key: "{{ vault_aws_dns.secret_key }}"
|
|
|
|
vars:
|
|
# Domains to manage DNS records for
|
|
domains:
|
|
- name: thesatelliteoflove.com
|
|
dns_records:
|
|
- name: "starpunk"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "git"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "social"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "audio"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "books"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "paper"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "snippets"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: cal
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: loclog
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: watcher
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: models
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: bookmarks
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: gotify
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: gotify-assistant
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: pdg
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: gokapi
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: id
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: auth # Tinyauth (was Authentik until 2026-10-31)
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: nerder.land
|
|
dns_records:
|
|
- name: "forms"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "listmonk"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "repaircafe"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "repair"
|
|
ip: "{{ network.netcup_ip }}"
|
|
|
|
# CAA: only these CAs may issue certificates for each domain (and its
|
|
# subdomains). Let's Encrypt is what Caddy uses; sectigo.com is ZeroSSL,
|
|
# Caddy's automatic fallback CA. Amazon covers links.thesatelliteoflove.com
|
|
# (CloudFront with an ACM certificate). No CA may issue wildcards.
|
|
caa_records:
|
|
- zone: thesatelliteoflove.com
|
|
records:
|
|
- '0 issue "letsencrypt.org"'
|
|
- '0 issue "sectigo.com"'
|
|
- '0 issue "amazon.com"'
|
|
- '0 issue "amazontrust.com"'
|
|
- '0 issue "awstrust.com"'
|
|
- '0 issue "amazonaws.com"'
|
|
- '0 issuewild ";"'
|
|
- zone: nerder.land
|
|
records:
|
|
- '0 issue "letsencrypt.org"'
|
|
- '0 issue "sectigo.com"'
|
|
- '0 issuewild ";"'
|
|
|
|
# DNS records to remove for decommissioned services
|
|
removed_records:
|
|
- name: thesatelliteoflove.com
|
|
dns_records:
|
|
- name: "santa" # Sneaky Klaus, removed
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "kutt" # old AWS IP, no longer ours (takeover risk)
|
|
ip: "44.202.81.119"
|
|
- name: "grist" # not served (cleanup 2026-11-27)
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "habits"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "office"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "podcasts"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "pdftools" # pointed at the Tailscale IP; nothing listens for it
|
|
ip: "{{ network.docker_host_ip }}"
|
|
- name: "home"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "pin"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "code"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "phlog"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "tasks"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "post"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "opds" # dir2opds, replaced by Kavita
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "sync" # kosync, replaced by Kavita
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "files"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "kanboard"
|
|
ip: "{{ network.netcup_ip }}"
|
|
- name: "grocy"
|
|
ip: "{{ network.netcup_ip }}"
|
|
|
|
tasks:
|
|
- name: Remove A records for decommissioned services
|
|
amazon.aws.route53:
|
|
state: absent
|
|
zone: "{{ item.0.name }}"
|
|
record: "{{ item.1.name + '.' + item.0.name }}"
|
|
type: A
|
|
ttl: 300
|
|
value: "{{ item.1.ip }}"
|
|
loop: "{{ query('subelements', removed_records, 'dns_records') }}"
|
|
loop_control:
|
|
loop_var: item
|
|
|
|
- name: Add A records for subdomains of each domain
|
|
amazon.aws.route53:
|
|
state: present
|
|
zone: "{{ item.0.name }}"
|
|
record: "{{ item.0.name if item.1.name == '@' else item.1.name + '.' + item.0.name }}"
|
|
type: A
|
|
ttl: 300
|
|
value: "{{ item.1.ip }}"
|
|
loop: "{{ query('subelements', domains, 'dns_records') }}"
|
|
loop_control:
|
|
loop_var: item
|
|
|
|
- name: Set CAA records restricting which CAs may issue certificates
|
|
amazon.aws.route53:
|
|
state: present
|
|
zone: "{{ item.zone }}"
|
|
record: "{{ item.zone }}"
|
|
type: CAA
|
|
ttl: 3600
|
|
value: "{{ item.records }}"
|
|
overwrite: true
|
|
loop: "{{ caa_records }}"
|