homelab/terraform/makefile
2024-05-09 09:14:25 +02:00

17 lines
565 B
Makefile

env := production
command ?= apply -auto-approve
deploy_vault:
ifneq (,$(wildcard ~/vaultUnseal/$(env)/rootkey))
VAULT_TOKEN=$(shell cat ~/vaultUnseal/$(env)/rootkey) tofu -chdir=vault $(command)
else
tofu -chdir=vault $(command)
endif
deploy_dns:
TF_VAR_powerDnsApiKey=$(shell vault kv get -field=API_KEY secrets/nomad/pdns) TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) tofu -chdir=dns $(command)
deploy_cloud:
TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) tofu -chdir=cloud $(command)