From c2733a8a1928a7fafcdcf2ed7fcbc9dae55928f5 Mon Sep 17 00:00:00 2001 From: ajacoutot Date: Sun, 14 Jun 2026 10:33:07 +0000 Subject: [PATCH] Add README to build in-house providers. --- sysutils/opentofu/Makefile | 1 + sysutils/opentofu/pkg/PLIST | 1 + sysutils/opentofu/pkg/README | 63 ++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+) create mode 100644 sysutils/opentofu/pkg/README diff --git a/sysutils/opentofu/Makefile b/sysutils/opentofu/Makefile index 73d3756a2b9..54dfdc317c8 100644 --- a/sysutils/opentofu/Makefile +++ b/sysutils/opentofu/Makefile @@ -3,6 +3,7 @@ COMMENT= declaratively manage infrastructure MODGO_MODNAME= github.com/opentofu/opentofu MODGO_VERSION= v1.12.2 DISTNAME= opentofu-${MODGO_VERSION} +REVISION= 0 CATEGORIES= sysutils net diff --git a/sysutils/opentofu/pkg/PLIST b/sysutils/opentofu/pkg/PLIST index 35d9dcc7ce7..9ff3f94c664 100644 --- a/sysutils/opentofu/pkg/PLIST +++ b/sysutils/opentofu/pkg/PLIST @@ -1 +1,2 @@ @bin bin/tofu +share/doc/pkg-readmes/${PKGSTEM} diff --git a/sysutils/opentofu/pkg/README b/sysutils/opentofu/pkg/README new file mode 100644 index 00000000000..8b8003df0ff --- /dev/null +++ b/sysutils/opentofu/pkg/README @@ -0,0 +1,63 @@ ++------------------------------------------------------------------------------- +| Running ${PKGSTEM} on OpenBSD ++------------------------------------------------------------------------------- + +Most plugins and providers are available for OpenBSD on the the OpenTofu +registry (https://search.opentofu.org/). + +Here's a sample build procedure for missing or in-house plugins and providers. + +Example: Terraform AWS provider; version 6.50.0 +=============================================== + +Building +-------- + +A few packages are required for building: + # pkg_add bash git gmake go + + $ git clone https://github.com/opentofu/terraform-provider-aws + $ cd terraform-provider-aws + +Choose the release tag you want to build: + $ git fetch --all --tags && git checkout tags/v6.50.0 -b 6.50.0 + +Go eats a lot of memory and you may need to bump your limits (`ulimit -d`). +Build the provider (manual fixes may be needed to properly build on OpenBSD) + $ gmake build + +The provider will be available at ${GOPATH}/bin/terraform-provider-aws. +GOPATH defaults to ${HOME}/go/bin. + +Installing +---------- + +Providers can be installed under any of these directories: + ${PWD}/terraform.d/plugins + ~/.terraform.d/plugins + ~/.local/share/terraform/plugins + ${TRUEPREFIX}/share/terraform/plugins + +They must follow the sub-hierarchy according to the plugin configuration. + +Using this code in the Terraform configuration... + +---8<------------------------- +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + version = "6.50.0" + } + } +} + +provider "aws" { + # Configuration options +} +---8<------------------------- + +... means the Terraform AWS provider for OpenBSD/amd64 must be installed as: + ${PLUGINSDIR}/registry.opentofu.org/hashicorp/aws/6.50.0/openbsd_amd64/terraform-provider-aws + +`tofu init` should now be able to detect this provider plugin.