Skip to content

eth-cscs/terraform-provider-manta

Repository files navigation

Manta terraform provider

1. Introduction

1.1. Context diagram

deployment terraform provider manta

1.2. Features

  • ✓ CRUD redfish endpoint

  • ✓ CRUD boot script

  • ✓ Switch power status of a node

  • ✓ Passing cloud-init data

  • ✓ Attribute IP address to a node mac address

  • ✓ Boot an O/S diskless

2. Steps

2.1. Testing environment

  1. Clone an external repository

    git clone --branch terraform-manta-provider https://github.com/t-h2o/deployment-recipes
    cd deployment-recipes/quickstart-pcs
  2. Start the OpenCHAMI’s services

    make run

2.2. Development

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.

2.3. Install Provider locally

Install all dependencies and build the provider.

go mod tidy
go install

After 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.

2.4. Edit terraform’s configuration to override the source for the Manta provider

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.

2.5. Verify the provider works

You can use the files in the examples/provider-install-verification/ directory to test the provider.

terraform -chdir=examples/provider-install-verification/ plan -var-file=tester.tfvars

3. Known issue

3.1. Hackypatch OpenCHAMI

usecase provider manta ochami csm

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

4. TODO

4.1. Manta web service

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}

5. Resources

5.1. What is Terraform provider

5.2. Examples of Terraform provider

About

Terraform Manta Provider

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages