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

View file

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

View file

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

View file

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