diff --git a/src/gitlab-tofu.sh b/src/gitlab-tofu.sh index dfeeac6ca881be5961229b311f842f9ddc5eb4bd..435b4bde8c139f8772c97232922c707dcb6528d3 100644 --- a/src/gitlab-tofu.sh +++ b/src/gitlab-tofu.sh @@ -15,10 +15,6 @@ if [ -z "$TF_FF_AUTO_URLENCODE_STATE_NAME" ]; then TF_FF_AUTO_URLENCODE_STATE_NAME=true fi -if [ -z "$TF_FF_AUTO_APPROVE_APPLY" ]; then - TF_FF_AUTO_APPROVE_APPLY=true -fi - # Helpers # Evaluate if this script is being sourced or executed directly. @@ -213,17 +209,12 @@ if [ $sourced -eq 0 ]; then case "${1}" in "apply") - auto_approve_args="" - if [ "${TF_FF_AUTO_APPROVE_APPLY}" = true ]; then - auto_approve_args="-auto-approve" - fi - $TF_IMPLICIT_INIT && terraform_init if [ "$TF_APPLY_NO_PLAN" = false ]; then - tofu "${TF_CHDIR_OPT}" "${@}" -input=false "${auto_approve_args}" "${TF_PLAN_CACHE}" + tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve "${TF_PLAN_CACHE}" else # shellcheck disable=SC2086 - tofu "${TF_CHDIR_OPT}" "${@}" -input=false "${auto_approve_args}" ${var_file_args} + tofu "${TF_CHDIR_OPT}" "${@}" -input=false -auto-approve ${var_file_args} fi ;; "destroy")