-
Clone an external repository
git clone --branch terraform-manta-provider https://github.com/t-h2o/deployment-recipes cd deployment-recipes/quickstart-pcs -
Start the OpenCHAMI’s services
make run
This provider is developed using the Terraform Plugin Framework. If you want to learn more, you can follow the Provider Plugin Framework tutorials in the HashiCorp website.
Install all dependencies and build the provider.
go mod tidy
go installAfter this, you should be able to find the provider’s binary in your local $GOBIN
directory or the bin directory of your local $GOPATH. By default, this location is $HOME/go/bin.
Generally, Terraform will download the provider from a Registry. In order to use a local
version of the provider, you need to tell Terraform to override the source for the provider.
This is done by creating a .terraformrc file in your home directory and adding the
following content:
provider_installation {
dev_overrides {
"registry.terraform.io/eth-cscs/manta" = "<PATH>"
}
# For all other providers, install them directly from their origin provider
# registries as normal. If you omit this, Terraform will _only_ use
# the dev_overrides block, and so no other providers will be available.
direct {}
}Where <PATH> is the path to the directory containing the provider binary (tipically
$HOME/go/bin/). For more information on the .terraformrc file, see
the Terraform documentation.
OpenCHAMI has a design issue: PCS and HSM have not the same power state.
Manta still in development and to keep going forward with the development of this terraform provider, we request directly to OpenCHAMI instead of using fully Manta. That can be an issue when we will switch the Manta’s backend to CSM.
It is the two functions that request directly OpenCHAMI:
-
Get the data of the node
-
Get the power status of the node
-
✓ fix errors of
golangci-lint run -
❏ reproduce
examplesfolder as standard (eg., terraform-provider-scaffolding-framework) -
❏ adapt tools folder
Reproduce these OpenCHAMI routes
-
❏
/cloud-init/admin/cluster-defaults -
❏
/cloud-init/admin/groups -
❏
/cloud-init/admin/groups/{groupDataName} -
❏
/hsm/v2/groups/{groupLabel}/members -
❏
/hsm/v2/groups/{groupLabel}/members/+{xname} -
❏
/hsm/v2/State/Components -
❏
/hsm/v2/State/Components/{id}
-
Creating a Terraform Provider for Just About Anything (text)
-
Creating a Terraform Provider for Just About Anything (video)
-
SDKv2 or Terraform Plugin Framework (Why choose the Terraform Plugin Framework over SDKv2?)
-
terraform-provider-example (simple)
-
terraform-provider-gitlab (complex)
-
Terraform plugin framework (documentation)