2024-09-24 23:10:59 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
include .env
|
|
|
|
export
|
|
|
|
|
2024-09-26 22:02:36 +00:00
|
|
|
DNS_OUTPUT = "dns/hosts.json"
|
|
|
|
SERVICES_OUTPUT = "inventory/group_vars/all/opentofu.yaml"
|
2024-09-24 23:10:59 +00:00
|
|
|
|
|
|
|
$(DNS_OUTPUT):
|
2024-09-26 22:02:36 +00:00
|
|
|
tofu output --json \
|
2024-09-24 23:10:59 +00:00
|
|
|
| jq 'with_entries(.value |= .value).hosts' \
|
2024-09-26 22:02:36 +00:00
|
|
|
> $(DNS_OUTPUT)
|
2024-09-24 23:10:59 +00:00
|
|
|
|
|
|
|
$(SERVICES_OUTPUT):
|
2024-09-26 22:02:36 +00:00
|
|
|
tofu output --json \
|
2024-09-24 23:10:59 +00:00
|
|
|
| yq -y '{opentofu: with_entries(.value |= .value)}' \
|
2024-09-26 22:02:36 +00:00
|
|
|
> $(SERVICES_OUTPUT)
|
2024-09-24 23:10:59 +00:00
|
|
|
|
|
|
|
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
|