2024-09-24 23:10:59 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
include .env
|
|
|
|
export
|
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
PWD := $(shell pwd)
|
2024-09-24 23:10:59 +00:00
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
.FORCE:
|
|
|
|
|
2024-10-06 17:08:13 +00:00
|
|
|
./inventory/group_vars/all/all_services.yml: .FORCE
|
|
|
|
tofu output --json \
|
|
|
|
| yq -y '{all_services: with_entries(.value |= .value).services | to_entries | map(.value)}' \
|
|
|
|
> ./inventory/group_vars/all/all_services.yml
|
|
|
|
|
|
|
|
./inventory/group_vars/all/opentofu.yml: .FORCE
|
|
|
|
tofu output --json \
|
|
|
|
| yq -y '{opentofu: with_entries(.value |= .value)}' \
|
|
|
|
> ./inventory/group_vars/all/opentofu.yml
|
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
./dns/hosts.json: .FORCE
|
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-10-03 01:46:55 +00:00
|
|
|
> ./dns/hosts.json
|
|
|
|
|
|
|
|
./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
|
2024-09-24 23:10:59 +00:00
|
|
|
|
|
|
|
|
2024-10-06 17:08:13 +00:00
|
|
|
output: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu.yml
|
2024-09-24 23:10:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
./types-dnscontrol.d.ts:
|
|
|
|
dnscontrol write-types
|
|
|
|
|
2024-10-06 15:08:25 +00:00
|
|
|
tofu:
|
|
|
|
tofu apply
|
2024-10-06 17:08:13 +00:00
|
|
|
@printf "\n=====\n\n"
|
2024-10-06 15:08:25 +00:00
|
|
|
$(MAKE) output
|
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
dns: ./types-dnscontrol.d.ts ./dns/hosts.json ./dns/services.json
|
2024-09-24 23:10:59 +00:00
|
|
|
dnscontrol push
|
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
dns-check: ./types-dnscontrol.d.ts ./dns/hosts.json ./dns/services.json
|
2024-09-24 23:10:59 +00:00
|
|
|
dnscontrol check-creds ovh
|