infrastructure/Makefile

55 lines
976 B
Makefile

SHELL := /bin/bash
TAGS ?= all
LIMIT ?= all
PWD := $(shell pwd)
.FORCE:
./dns/hosts.json: .FORCE
tofu output --json hosts \
> ./dns/hosts.json
./dns/services.json: .FORCE
ansible-playbook \
-e services_json_file=$(PWD)/dns/services.json \
playbooks/create-services-for-dnscontrol.yml
./dns/dkim-ses.json: .FORCE
tofu output --json aws_ses_dkim \
> ./dns/dkim-ses.json
output: ./dns/hosts.json ./dns/services.json ./dns/dkim-ses.json
./types-dnscontrol.d.ts:
dnscontrol write-types
tofu:
tofu apply
@printf "\n=====\n\n"
$(MAKE) output
dns: output
dnscontrol push
dns-check: output
dnscontrol check-creds ovh
tofu-dns:
$(MAKE) tofu
$(MAKE) dns
all:
$(MAKE) tofu-dns
@printf "\n=====\n\n"
ansible-playbook ./playbooks/stop-and-backup-unused.yml -l $(LIMIT)
ansible-playbook ./playbooks/serguzim.net.yml -t $(TAGS) -l $(LIMIT)
$(MAKE) visualize
visualize:
./scripts/visualize.py | d2 - infrastructure.svg
new_role:
./scripts/new_role.sh