Describe the bug
There may not be a good fix for this, but what I noticed is that if I set TERRAGRUNT_TFPATH to tofu, Terragrunt will correctly find / use opentofu instead of Terraform, but then barfs when it finds a wrapper unless TERRAGRUNT_TFPATH is also set to tofu-bin. This is an easy fix once you figure out what the issue is (either by updating TERRAGRUNT_TFPATH, or by configuring the setupu-opentofu action to not use the wrapper), but a bit tricky to debug in a CI environment. Maybe because of a symlink?
for DIR in $(/bin/ls -d environments/*); do
terragrunt --terragrunt-working-dir "$DIR" run-all init
terragrunt --terragrunt-working-dir "$DIR" run-all validate
done
shell: /usr/bin/bash -e {0}
env:
CHECKPOINT_DISABLE: true
TERRAGRUNT_DISABLE_INIT: true
TERRAGRUNT_NON_INTERACTIVE: true
TERRAGRUNT_TFPATH: tofu
TF_CLI_ARGS_init: -compact-warnings
TF_CLI_ARGS_validate: -compact-warnings
TF_IN_AUTOMATION: true
TOFU_CLI_PATH: /home/runner/work/_temp/37640e4d-40fa-411b-af9d-b13569f189a9
time=2023-11-30T23:44:13Z level=info msg=The stack at environments/xxxx will be processed in the following order for command init:
Group 1
-11-30T23:44:13Z level=error msg=Module /home/runner/work/tofu/tofu/environments/xxx/network has finished with an error: Unable to parse Terraform version output: [command]/home/runner/work/_temp/37640e4d-40fa-411b-af9d-b13569f189a9/tofu-bin --version
OpenTofu v1.6.0-beta1
on linux_amd64
provider registry.opentofu.org/hashicorp/google-beta v5.7.0
time=2023-11-30T23:44:13Z level=error msg=Unable to determine underlying exit code, so Terragrunt will exit with error code 1
Error: Process completed with exit code 1.
[ ] Screenshots
Versions
Terragrunt version: 0.53.8
Terraform version: 1.6.0 (OpenTofu)
Environment details (Ubuntu 20.04, Windows 10, etc.): Ubuntu (GHA)
Additional context
2818 / #2817 are not really related, other than it being why I dug into the regex, but I opened it anyway
Describe the bug There may not be a good fix for this, but what I noticed is that if I set
TERRAGRUNT_TFPATH
totofu
, Terragrunt will correctly find / useopentofu
instead of Terraform, but then barfs when it finds a wrapper unlessTERRAGRUNT_TFPATH
is also set totofu-bin
. This is an easy fix once you figure out what the issue is (either by updatingTERRAGRUNT_TFPATH
, or by configuring thesetupu-opentofu
action to not use the wrapper), but a bit tricky to debug in a CI environment. Maybe because of a symlink?To Reproduce
Expected behavior Terragrunt to initialize
Nice to have
-11-30T23:44:13Z level=error msg=Module /home/runner/work/tofu/tofu/environments/xxx/network has finished with an error: Unable to parse Terraform version output: [command]/home/runner/work/_temp/37640e4d-40fa-411b-af9d-b13569f189a9/tofu-bin --version OpenTofu v1.6.0-beta1 on linux_amd64
Versions
0.53.8
1.6.0
(OpenTofu)Additional context
2818 / #2817 are not really related, other than it being why I dug into the regex, but I opened it anyway