homelab/terraform/makefile
vincent 2f6c814fb1
Some checks failed
continuous-integration/drone/push Build is failing
CI: terraform makefile command parameter
2024-04-27 14:29:38 +02:00

17 lines
585 B
Makefile

env := production
command ?= apply -auto-approve
deploy_vault:
ifneq (,$(wildcard ~/vaultUnseal/$(env)/rootkey))
VAULT_TOKEN=$(shell cat ~/vaultUnseal/$(env)/rootkey) terraform -chdir=vault $(command)
else
terraform -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) terraform -chdir=dns $(command)
deploy_cloud:
TF_VAR_hetznerApiKey=$(shell vault kv get -field=hdns_token secrets/hetzner) terraform -chdir=cloud $(command)