infrastructure/Makefile

36 lines
869 B
Makefile
Raw Normal View History

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:
./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-03 01:46:55 +00:00
./inventory/group_vars/all/opentofu.yaml: .FORCE
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-10-03 01:46:55 +00:00
> ./inventory/group_vars/all/opentofu.yaml
2024-09-24 23:10:59 +00:00
2024-10-03 01:46:55 +00:00
outputs: ./dns/hosts.json ./dns/services.json ./inventory/group_vars/all/opentofu.yaml
2024-09-24 23:10:59 +00:00
./types-dnscontrol.d.ts:
dnscontrol write-types
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