Skip to content

rsahuHitachi/terraform-provider-hitachi

 
 

Repository files navigation

Terraform Provider Hitachi

Build RPM package

You must be a superuser to build the package.

In build.sh, modify this variable to point to your hitachi terraform source code directory

TERRAFORM_SRC_DIR

You must use Golang version 1.20, and set GOPATH to your Golang v1.20 directory.

# export GOPATH=/usr/local/go
# ./build

The RPM package is in /root/rpmbuild/RPMS/x86_64/HV_Storage_Terraform-02.0.0-1.el7.x86_64.rpm

Install RPM package

You must be a superuser to install the rpm package.

Check what RPM version is installed

# /usr/bin/rpm -qa HV_Storage_Terraform

Uninstall the old version

# /usr/bin/rpm -e HV_Storage_Terraform

Install the new version

# /usr/bin/rpm -Uvh HV_Storage_Terraform-02.0.0-1.el7.x86_64.rpm

Check if the hitachi terraform plugin is installed. It must be linked to /opt/hitachi/terraform/terraform-provider-hitachi/bin/terraform-provider-hitachi

# ls -l /root/.terraform.d/plugins/localhost/hitachi-vantara/hitachi/2.0/linux_amd64/terraform-provider-hitachi 
lrwxrwxrwx. 1 root root 80 Aug  9 21:55 /root/.terraform.d/plugins/localhost/hitachi-vantara/hitachi/2.0/linux_amd64/terraform-provider-hitachi -> /opt/hitachi/terraform/terraform-provider-hitachi/bin/terraform-provider-hitachi

Use the tf samples

Navigate to /opt/hitachi/terraform/terraform-provider-hitachi/examples

# cd /opt/hitachi/terraform/terraform-provider-hitachi/examples

Go to any examples directory. Example:

# cd data-sources/hitachi_vsp_storage

If not the first time using the examples directory, do cleanup

# rm .terraform .terraform.lock.hcl terraform.tfstate
# rm -rf san_settings

Modify provider.tf and storage.tf with your storage information, then do:

# terraform init
# terraform apply

For developers only without the RPM package

First, build and install the provider.

$ make all

Then, navigate to the examples directory.

$ cd examples

Run the following command to initialize the workspace and apply the sample configuration.

$ terraform init && terraform apply

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.3%
  • Other 0.7%