Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support falling back to tofu binary if terraform is not found but tofu is (And maybe allow the fallback to be an environment variable) #159

Open
x86-39 opened this issue Jul 13, 2024 · 0 comments
Labels
type/enhancement New feature or request

Comments

@x86-39
Copy link
Contributor

x86-39 commented Jul 13, 2024

SUMMARY

As OpenTofu and Terraform both should work for this collection, I think it would be a good idea to fall back to tofu if it is found and terraform is not

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

The inventory provider, all modules and the lookup provider

ADDITIONAL INFORMATION

OpenTofu is getting more popular, and it's compatible with Terraform. People should be able to use OpenTofu instead of Terraform without needing to hardcode the binary path in the inventory file/tasks.

Alternatively, or both, an environment variable could be used to get the Terraform/Tofu binary path. This would not break any deployments, as the hardcoded path in the task/inventory would still take precedent.

My proposed search order is as follows:

  • The binary path set in the inventory file/task
  • An environment variable (TF_BINARY_PATH maybe? Open to suggestions)
  • Searching for terraform in path
  • Searching for tofu in path
    This would not break any existing deployments, as the set variable and Terraform still take precedent over Tofu, and the environment variable wouldn't be set.

If this sounds like something that would be accepted, I can make a PR for it

@gravesm gravesm added the type/enhancement New feature or request label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants