Migrate dns part

This commit is contained in:
Tobias Reisinger 2024-09-25 01:10:59 +02:00
commit 344710e831
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
12 changed files with 377 additions and 0 deletions

31
Makefile Normal file
View file

@ -0,0 +1,31 @@
SHELL := /bin/bash
include .env
export
DNS_OUTPUT = "dns/hosts.js"
SERVICES_OUTPUT = "services/inventory/group_vars/all/opentofu.yaml"
$(DNS_OUTPUT):
cd opentofu && \
tofu output --json \
| jq 'with_entries(.value |= .value).hosts' \
> ../dns/hosts.json
$(SERVICES_OUTPUT):
cd opentofu && \
tofu output --json \
| yq -y '{opentofu: with_entries(.value |= .value)}' \
> ../services/inventory/group_vars/all/opentofu.yaml
outputs: $(DNS_OUTPUT) $(SERVICES_OUTPUT)
./types-dnscontrol.d.ts:
dnscontrol write-types
dns: $(DNS_OUTPUT) ./types-dnscontrol.d.ts
dnscontrol push
dns-check: $(DNS_OUTPUT) ./types-dnscontrol.d.ts
dnscontrol check-creds ovh