Restructure: move infra packages to root level
This commit is contained in:
24
terraform-pve/run.sh
Executable file
24
terraform-pve/run.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# How to use this file TF_VAR_vmid_base=3550 TF_VAR_lxc_count=4 ./run.sh apply -auto-approve
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Forward all TF_VAR_* environment variables into the container
|
||||
TF_VAR_ARGS=""
|
||||
while IFS='=' read -r name _; do
|
||||
TF_VAR_ARGS="$TF_VAR_ARGS -e $name"
|
||||
done < <(env | grep '^TF_VAR_')
|
||||
|
||||
case "${1:-plan}" in
|
||||
init|validate|plan|apply|destroy)
|
||||
docker compose run --rm $TF_VAR_ARGS terraform "$1" "${@:2}"
|
||||
;;
|
||||
shell)
|
||||
docker compose run --rm $TF_VAR_ARGS terraform sh
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [init|plan|apply|destroy|shell]"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user