30 lines
874 B
Makefile
30 lines
874 B
Makefile
SHELL := /bin/bash
|
|
.ONESHELL:
|
|
.SHELLFLAGS := -eu -o pipefail -c
|
|
|
|
MAKEFILE_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
|
|
ANSIBLE_DIR := $(abspath $(MAKEFILE_DIR)/../ansible)
|
|
TERRAFORM_DIR := $(abspath $(MAKEFILE_DIR)/../terraform/stacks/powerdns)
|
|
|
|
.PHONY: all \
|
|
install_powerdns setup_dns_zone_and_records setup_systemd_resolved_config
|
|
|
|
all: setup_systemd_resolved_config
|
|
|
|
install_powerdns:
|
|
cd "$(ANSIBLE_DIR)"
|
|
ansible-playbook playbooks/dns/install_powerdns.yml -i inventory.ini
|
|
|
|
setup_dns_zone_and_records: install_powerdns
|
|
cd "$(TERRAFORM_DIR)"
|
|
terraform init
|
|
terraform plan -var-file="terraform.tfvars"
|
|
terraform apply -auto-approve -var-file="terraform.tfvars"
|
|
|
|
setup_systemd_resolved_config: setup_dns_zone_and_records
|
|
cd "$(ANSIBLE_DIR)"
|
|
ansible-playbook playbooks/dns/setup_systemd_resolved_config.yml -i inventory.ini
|
|
|
|
# make -f 04_setup_dns.mk
|
|
|