2024-09-24 23:10:59 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
2024-10-13 16:30:14 +00:00
|
|
|
TAGS ?= all
|
|
|
|
|
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-17 23:34:55 +00:00
|
|
|
./inventory/group_vars/all/all_services.yml: .FORCE
|
2024-10-22 16:29:03 +00:00
|
|
|
tofu output --json services \
|
|
|
|
| yq -y '{all_services: .}' \
|
2024-10-17 23:34:55 +00:00
|
|
|
> ./inventory/group_vars/all/all_services.yml
|
2024-10-06 17:08:13 +00:00
|
|
|
|
2024-10-17 23:34:55 +00:00
|
|
|
./inventory/group_vars/all/opentofu.yml: .FORCE
|
2024-10-06 17:08:13 +00:00
|
|
|
tofu output --json \
|
|
|
|
| yq -y '{opentofu: with_entries(.value |= .value)}' \
|
2024-10-17 23:34:55 +00:00
|
|
|
> ./inventory/group_vars/all/opentofu.yml
|
2024-10-06 17:08:13 +00:00
|
|
|
|
2024-10-03 01:46:55 +00:00
|
|
|
./dns/hosts.json: .FORCE
|
2024-10-22 15:44:00 +00:00
|
|
|
tofu output --json hosts \
|
2024-10-03 01:46:55 +00:00
|
|
|
> ./dns/hosts.json
|
|
|
|
|
2024-10-17 23:34:55 +00:00
|
|
|
./dns/services.json: ./inventory/group_vars/all/all_services.yml
|
2024-10-03 01:46:55 +00:00
|
|
|
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-22 15:44:00 +00:00
|
|
|
./dns/dkim-ses.json: .FORCE
|
|
|
|
tofu output --json aws_ses_dkim \
|
|
|
|
> ./dns/dkim-ses.json
|
|
|
|
|
|
|
|
|
|
|
|
output-dns: ./dns/hosts.json ./dns/services.json ./dns/dkim-ses.json
|
2024-09-24 23:10:59 +00:00
|
|
|
|
2024-10-22 15:44:00 +00:00
|
|
|
output-ansible: ./inventory/group_vars/all/opentofu.yml
|
2024-09-24 23:10:59 +00:00
|
|
|
|
2024-10-22 15:44:00 +00:00
|
|
|
output: output-dns output-ansible
|
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-22 15:44:00 +00:00
|
|
|
dns: output-dns
|
2024-09-24 23:10:59 +00:00
|
|
|
dnscontrol push
|
|
|
|
|
2024-10-22 15:44:00 +00:00
|
|
|
dns-check: output-dns
|
2024-09-24 23:10:59 +00:00
|
|
|
dnscontrol check-creds ovh
|
2024-10-07 19:17:35 +00:00
|
|
|
|
|
|
|
all:
|
|
|
|
$(MAKE) tofu
|
|
|
|
$(MAKE) dns
|
|
|
|
@printf "\n=====\n\n"
|
2024-10-19 13:18:54 +00:00
|
|
|
ansible-playbook ./playbooks/stop-and-backup-unused.yml -t $(TAGS)
|
2024-10-13 16:30:14 +00:00
|
|
|
ansible-playbook ./playbooks/serguzim.net.yml -t $(TAGS)
|
2024-10-14 15:49:44 +00:00
|
|
|
|
|
|
|
visualize:
|
2024-10-19 16:41:29 +00:00
|
|
|
./visualize.py | d2 - infrastructure.svg
|
2024-10-14 15:49:44 +00:00
|
|
|
|