Skip to content

infra: make the Terraform/OpenTofu binary configurable #295

Description

@piwi3910

Problem

The infra domain picks terraform or tofu per directory by sniffing .terraform.lock.hcl (#294): a "tofu init" header or registry.opentofu.org providers means tofu. That's a heuristic. It misses directories with no lockfile yet (for example no providers, or not initialised), and it can't express a repo that deliberately wants one tool everywhere.

It surfaced in azrtydxb/azrty-infra: before #294, terraform validate failed with "Missing required provider" on a valid OpenTofu stack and blocked the commit gate.

Ask

Make the binary configurable per repository (optionally per directory), with the lockfile detection as the fallback when nothing is configured. For example, in procoder's repo config:

infra:
  terraform_binary: tofu   # terraform | tofu | auto (default)

procoder doctor / init should require and install whatever the config names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions