diff --git a/Taskfile.yaml b/Taskfile.yaml index b9aad4a..4c600c7 100644 --- a/Taskfile.yaml +++ b/Taskfile.yaml @@ -4,13 +4,11 @@ includes: aqua: lib/aqua aws: lib/aws components: lib/components - cursor: lib/cursor mixins: lib/mixins os: lib/os-modules snaplet: lib/snaplet - terraform: - taskfile: lib/terraform - aliases: [tf] + tf: + taskfile: lib/tf toolbox: lib/toolbox tasks: {} diff --git a/aqua.yaml b/aqua.yaml index 7637986..01a9de8 100644 --- a/aqua.yaml +++ b/aqua.yaml @@ -1,11 +1,11 @@ --- registries: - type: standard - ref: v4.78.0 # renovate: depName=aquaproj/aqua-registry + ref: v4.433.0 # renovate: depName=aquaproj/aqua-registry packages: - - name: go-task/task@v3.31.0 - - name: TomWright/dasel@v2.4.1 - - name: stedolan/jq@jq-1.7.1 + - name: go-task/task@v3.45.4 + - name: TomWright/dasel@v2.8.1 + - name: stedolan/jq@jq-1.8.1 tags: [cursor] - - name: cli/cli@v2.74.2 + - name: cli/cli@v2.83.0 tags: [gh] diff --git a/lib/terraform/Taskfile.yml b/lib/tf/Taskfile.yml similarity index 87% rename from lib/terraform/Taskfile.yml rename to lib/tf/Taskfile.yml index 2b43dd0..8035bd1 100644 --- a/lib/terraform/Taskfile.yml +++ b/lib/tf/Taskfile.yml @@ -24,6 +24,8 @@ tasks: sh: echo "{{.BACKEND_CONFIG_PATH}}/{{.WORKSPACE}}.backend.tf" TFVARS_FILE: sh: echo "{{.TFVARS_PATH}}/{{.WORKSPACE}}.tfvars" + TF_CMD: + sh: '[ "${USE_TERRAFORM}" = "true" ] && echo "terraform" || echo "tofu"' init: desc: Initialize Terraform working directory with a backend configuration file. @@ -39,7 +41,7 @@ tasks: - sh: test -f {{.BACKEND_CONFIG_FILE}} msg: "Backend configuration file does not exist: {{.BACKEND_CONFIG_FILE}}" cmds: - - terraform init -backend-config {{.BACKEND_CONFIG_FILE}} {{.TF_ARGS}} + - "{{.TF_CMD}} init -backend-config {{.BACKEND_CONFIG_FILE}} {{.TF_ARGS}}" plan: desc: Generate a Terraform execution plan Terraform loading variable values from the given file. @@ -56,8 +58,8 @@ tasks: - sh: test -f {{.TFVARS_FILE}} msg: "Variables file does not exist: {{.TFVARS_FILE}}" cmds: - - terraform workspace select -or-create {{.WORKSPACE}} - - terraform plan -var-file {{.TFVARS_FILE}} {{.TF_ARGS}} + - "{{.TF_CMD}} workspace select -or-create {{.WORKSPACE}}" + - "{{.TF_CMD}} plan -var-file {{.TFVARS_FILE}} {{.TF_ARGS}}" apply: desc: Create or update infrastructure according to Terraform configuration files in the current directory. @@ -74,8 +76,8 @@ tasks: - sh: test -f {{.TFVARS_FILE}} msg: "Variables file does not exist: {{.TFVARS_FILE}}" cmds: - - terraform workspace select -or-create {{.WORKSPACE}} - - terraform apply -var-file {{.TFVARS_FILE}} {{.TF_ARGS}} + - "{{.TF_CMD}} workspace select -or-create {{.WORKSPACE}}" + - "{{.TF_CMD}} apply -var-file {{.TFVARS_FILE}} {{.TF_ARGS}}" refresh: desc: Refresh the Terraform state to match the real-world infrastructure (safer via apply -refresh-only). @@ -92,5 +94,5 @@ tasks: - sh: test -f {{.TFVARS_FILE}} msg: "Variables file does not exist: {{.TFVARS_FILE}}" cmds: - - terraform workspace select -or-create {{.WORKSPACE}} - - terraform apply -refresh-only -var-file {{.TFVARS_FILE}} {{.TF_ARGS}} + - "{{.TF_CMD}} workspace select -or-create {{.WORKSPACE}}" + - "{{.TF_CMD}} apply -refresh-only -var-file {{.TFVARS_FILE}} {{.TF_ARGS}}"