fix: apikey loading was broken
This commit is contained in:
2
Makefile
2
Makefile
@@ -50,7 +50,7 @@ sops-setup: ## Copy age key to SOPS default path (~/.config/sops/age/keys.txt)
|
||||
@echo "✔ SOPS key path set (~/.config/sops/age/keys.txt). Alternatively export SOPS_AGE_KEY."
|
||||
|
||||
sops-edit: ## Edit the global secrets with SOPS
|
||||
sops inventory/group_vars/secrets.sops.yaml
|
||||
sops secrets/hetzner-token.yaml
|
||||
|
||||
sops-encrypt: ## Encrypt a file in place: make sops-encrypt FILE=secrets/foo.yaml
|
||||
@[ -n "$(FILE)" ] || (echo "Usage: make sops-encrypt FILE=secrets/xxx.yaml" && exit 1)
|
||||
|
||||
@@ -63,8 +63,8 @@ python3 scripts/new_host.py \
|
||||
ok "Inventory updated: $NAME → inventory/servers.yaml"
|
||||
|
||||
# --- Decrypt Hetzner token and apply Terraform ---
|
||||
HCLOUD_TOKEN="$(sops -d --extract '["ops"]["hcloud_token"]' inventory/group_vars/secrets.sops.yaml 2>/dev/null || true)"
|
||||
[[ -n "$HCLOUD_TOKEN" ]] || fail "Could not decrypt ops.hcloud_token from inventory/group_vars/secrets.sops.yaml. Ensure SOPS_AGE_KEY or keys.txt is set and token exists."
|
||||
HCLOUD_TOKEN="$(sops -d --extract '["hetzner"]["token"]' secrets/hetzner-token.sops.yaml 2>/dev/null)"
|
||||
[[ -n "$HCLOUD_TOKEN" ]] || fail "Could not decrypt ops.hcloud_token from secrets/hetzner-token.sops.yaml. Ensure SOPS_AGE_KEY or keys.txt is set and token exists."
|
||||
|
||||
pushd terraform/hetzner >/dev/null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user