Improve dnsconfig a bit

This commit is contained in:
Tobias Reisinger 2024-10-29 14:10:54 +01:00
parent 53d9cd1190
commit 6fadc45e24
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
5 changed files with 20 additions and 9 deletions

View file

@ -23,7 +23,7 @@ PWD := $(shell pwd)
./dns/services.json: ./inventory/group_vars/all/all_services.yml
ansible-playbook \
-e services_json_file=$(PWD)/dns/services.json \
playbooks/create_services_for_dnscontrol.yml
playbooks/create-services-for-dnscontrol.yml
./dns/dkim-ses.json: .FORCE
tofu output --json aws_ses_dkim \
@ -50,9 +50,12 @@ dns: output-dns
dns-check: output-dns
dnscontrol check-creds ovh
all:
tofu-dns:
$(MAKE) tofu
$(MAKE) dns
all:
$(MAKE) tofu-dns
@printf "\n=====\n\n"
ansible-playbook ./playbooks/stop-and-backup-unused.yml -t $(TAGS)
ansible-playbook ./playbooks/serguzim.net.yml -t $(TAGS)

View file

@ -28,10 +28,18 @@ function collect_services(domain) {
}
function my_host_record(target, host) {
return [
A(target, host.ipv4_address),
AAAA(target, host.ipv6_address)
];
switch (target) {
case "db":
return [
A(target, host.ipv4_address_vpn),
AAAA(target, host.ipv6_address_vpn)
];
default:
return [
A(target, host.ipv4_address),
AAAA(target, host.ipv6_address)
];
}
}
function verify_amazon_ses(dkims) {

View file

@ -81,10 +81,7 @@ D("serguzim.me", REG_OVH, DnsProvider(DSP_OVH),
NS("acme", services["acme_dns"].resolve_host().fqdn + "."),
CNAME("db", "node002.vpn.serguzim.net."),
// Other records
A("loetlabor", "141.23.124.187"),
A("ls", "62.141.37.39"),
A("test", "62.141.37.39"),
CNAME("cloud", "nx45221.your-storageshare.de.")

View file

@ -336,6 +336,9 @@ services = {
"postgresql" = {
host = "node002"
dns = [{
domain = "db.serguzim.me"
}]
backup = [{
name = "postgresql"
type = "hook"