Skip to content

Commit

Permalink
Merge pull request #287 from HewlettPackard/ReadmeChanges_Terraform13
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
nabhajit-ray authored Apr 1, 2021
2 parents e75e9bf + 4d5688e commit cefd1fa
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Format
run: if ![ -z "$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)" ]; then exit 1; fi
run: if [ ! -z "$(find . -type f -name "*.go" -not -path "./vendor/*" | sed "s|^\./||" | xargs gofmt -l)" ]; then exit 1; fi
if: matrix.platform == 'ubuntu-latest'
- name: Vet
run: go vet $(go list ./... | grep -v '/vendor/')
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)

# [v6.1.0-12] (Unreleased)
# [v6.0.0-13]
#### Major changes
1.This release is validated to support Terraform 0.13. Terraform 0.13 support HCL2 and enables automated installation of the HPE OneView Terraform Provider.

### Bug fixes & Enhancements:
- [#277] (https://github.com/HewlettPackard/terraform-provider-oneview/issues/277) SPT Import configuration issue
Expand Down
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM golang:alpine
MAINTAINER "Priyanka Sood <[email protected]>"

ENV TERRAFORM_VERSION=0.12.29
ENV TERRAFORM_VERSION=0.13.6

ENV USER root
RUN mkdir -p /usr/local/terraform
Expand All @@ -21,8 +21,6 @@ WORKDIR /go/src/github.com/HewlettPackard/terraform-provider-oneview
COPY . /go/src/github.com/HewlettPackard/terraform-provider-oneview

RUN cd $GOPATH/src/github.com/HewlettPackard/terraform-provider-oneview
RUN go build -o $GOPATH/bin/terraform-provider-oneview
RUN mv $GOPATH/bin/terraform-provider-oneview /usr/local/terraform/

RUN go get github.com/kardianos/govendor
ENV PATH $PATH:/usr/local/terraform/
42 changes: 20 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

## Build Status

OV Version |6.00| 5.60 | 5.50
| ------------- |:-------------:| -------------:| -------------:|
SDK Version/Tag |[v6.0.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-12)| [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) |
Build Status | ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)| ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)| ![Build status](https://ci.appveyor.com/api/projects/status/u84505l6syp70013?svg=true)|
OV Version |6.0.0|6.00| 5.60 | 5.50
| ------------- |:-------------:| -------------:| -------------:|--------------:|
SDK Version/Tag |[v6.0.0-13 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-13)|[v6.0.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v6.0.0-12)| [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) | [v1.7.0-12 ](https://github.com/HewlettPackard/terraform-provider-oneview/releases/tag/v1.7.0-12) |
Build Status | [![Build status](https://action-badges.now.sh/JasonEtco/action-badges)](https://github.com/HewlettPackard/terraform-provider-oneview/actions/runs/707591356)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)| [![Build status](https://api.travis-ci.com/HewlettPackard/terraform-provider-oneview.svg)](https://travis-ci.org/github/HewlettPackard/terraform-provider-oneview/builds)|
```
Note: v1.7.0-12 onwards supports Terraform 0.12.xx
Note: v6.0.0-13 onwards supports Terraform 0.13.xx
```
## Introduction

Expand Down Expand Up @@ -36,10 +36,10 @@ The light weight containerized version of the HPE OneView SDK for Terraform is a

```bash
# Download and store a local copy of oneview-sdk-for-terraform and use it as a Docker Image.
$ docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-12-OV6.0
$ docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-13-OV6.0
# Run docker commands below given, which will in turn create a sh session
# where you can create files, issue commands and execute the examples.
$ docker run -it docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-12-OV6.0 /bin/sh
$ docker run -it docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-terraform:v6.0.0-13-OV6.0 /bin/sh
```

### Local Setup
Expand All @@ -66,25 +66,23 @@ $ export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

- Installing Terraform

Install Terraform 0.12.x from [here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists).
Install Terraform 0.13.x from [here](https://www.terraform.io/downloads.html) and save it into `/usr/local/bin/terraform` folder (create it if it doesn't exists).

```bash
```

- Install Oneview Terraform Provider SDK
```go
# Download the source code for terraform-provider-oneview
# Build the needed binary
# Get the branch 'Terraform-0.12' terraform-provider-oneview which is supports Terraform v0.12.x.

$ git clone -b Terraform-0.12 https://github.com/HewlettPackard/terraform-provider-oneview.git
$ cd terraform-provider-oneview
# Build the provider
$ go build -o terraform-provider-oneview
# Create the plugin location if it does not exist and copy the provider binary there.
$ mkdir -p ~/.terraform.d/plugins/
$ mv terraform-provider-oneview ~/.terraform.d./plugins/
- Install Oneview Terraform Provider SDK from Terraform Registry

Terraform 0.13 added support for automatically downloading providers from
the terraform registry. Add the following to your terraform project

```hcl
terraform {
required_providers {
oneview = {
source = "HewlettPackard/oneview"
}
}
```
## Configuration

### Environment Variables
Expand Down
10 changes: 5 additions & 5 deletions oneview/data_source_server_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,11 +725,11 @@ func dataSourceServerProfileRead(d *schema.ResourceData, meta interface{}) error
for _, controller := range serverProfile.LocalStorage.Controllers {

controllers = append(controllers, map[string]interface{}{
"device_slot": controller.DeviceSlot,
"drive_write_cache": controller.DriveWriteCache,
"import_configuration": controller.ImportConfiguration,
"initialize": controller.Initialize,
"mode": controller.Mode,
"device_slot": controller.DeviceSlot,
"drive_write_cache": controller.DriveWriteCache,
"import_configuration": controller.ImportConfiguration,
"initialize": controller.Initialize,
"mode": controller.Mode,
"predictive_spare_rebuild": controller.PredictiveSpareRebuild,
})
logicaldrives := make([]map[string]interface{}, 0, len(controller.LogicalDrives))
Expand Down
8 changes: 4 additions & 4 deletions oneview/data_source_server_profile_template.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ func dataSourceServerProfileTemplateRead(d *schema.ResourceData, meta interface{
})
}
controllers = append(controllers, map[string]interface{}{
"device_slot": spt.LocalStorage.Controllers[i].DeviceSlot,
"initialize": *spt.LocalStorage.Controllers[i].Initialize,
"drive_write_cache": spt.LocalStorage.Controllers[i].DriveWriteCache,
"mode": spt.LocalStorage.Controllers[i].Mode,
"device_slot": spt.LocalStorage.Controllers[i].DeviceSlot,
"initialize": *spt.LocalStorage.Controllers[i].Initialize,
"drive_write_cache": spt.LocalStorage.Controllers[i].DriveWriteCache,
"mode": spt.LocalStorage.Controllers[i].Mode,
"predictive_spare_rebuild": spt.LocalStorage.Controllers[i].PredictiveSpareRebuild,
"logical_drives": logicalDrives,
})
Expand Down
24 changes: 12 additions & 12 deletions oneview/resource_logical_interconnect_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface

interconnectSettings := make([]map[string]interface{}, 0, 1)
interconnectSetting := map[string]interface{}{
"type": logicalInterconnectGroup.EthernetSettings.Type,
"type": logicalInterconnectGroup.EthernetSettings.Type,
"fast_mac_cache_failover": *logicalInterconnectGroup.EthernetSettings.EnableFastMacCacheFailover,
"network_loop_protection": *logicalInterconnectGroup.EthernetSettings.EnableNetworkLoopProtection,
"pause_flood_protection": *logicalInterconnectGroup.EthernetSettings.EnablePauseFloodProtection,
Expand All @@ -1729,16 +1729,16 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface
if logicalInterconnectGroup.IgmpSettings != nil {
igmpSettings := make([]map[string]interface{}, 0, 1)
igmpSetting := map[string]interface{}{
"category": logicalInterconnectGroup.IgmpSettings.Category,
"consistency_checking": logicalInterconnectGroup.IgmpSettings.ConsistencyChecking,
"created": logicalInterconnectGroup.IgmpSettings.Created,
"dependent_resource_uri": logicalInterconnectGroup.IgmpSettings.DependentResourceUri,
"description": logicalInterconnectGroup.IgmpSettings.Description,
"etag": logicalInterconnectGroup.IgmpSettings.ETAG,
"igmp_snooping": *logicalInterconnectGroup.IgmpSettings.EnableIgmpSnooping,
"prevent_flooding": *logicalInterconnectGroup.IgmpSettings.EnablePreventFlooding,
"proxy_reporting": *logicalInterconnectGroup.IgmpSettings.EnableProxyReporting,
"id": logicalInterconnectGroup.IgmpSettings.ID,
"category": logicalInterconnectGroup.IgmpSettings.Category,
"consistency_checking": logicalInterconnectGroup.IgmpSettings.ConsistencyChecking,
"created": logicalInterconnectGroup.IgmpSettings.Created,
"dependent_resource_uri": logicalInterconnectGroup.IgmpSettings.DependentResourceUri,
"description": logicalInterconnectGroup.IgmpSettings.Description,
"etag": logicalInterconnectGroup.IgmpSettings.ETAG,
"igmp_snooping": *logicalInterconnectGroup.IgmpSettings.EnableIgmpSnooping,
"prevent_flooding": *logicalInterconnectGroup.IgmpSettings.EnablePreventFlooding,
"proxy_reporting": *logicalInterconnectGroup.IgmpSettings.EnableProxyReporting,
"id": logicalInterconnectGroup.IgmpSettings.ID,
"igmp_idle_timeout_interval": logicalInterconnectGroup.IgmpSettings.IgmpIdleTimeoutInterval,
"igmp_snooping_vlan_ids": logicalInterconnectGroup.IgmpSettings.IgmpSnoopingVlanIds,
"modified": logicalInterconnectGroup.IgmpSettings.Modified,
Expand Down Expand Up @@ -1821,7 +1821,7 @@ func resourceLogicalInterconnectGroupRead(d *schema.ResourceData, meta interface

qualityOfService := make([]map[string]interface{}, 0, 1)
qualityOfService = append(qualityOfService, map[string]interface{}{
"type": logicalInterconnectGroup.QosConfiguration.Type,
"type": logicalInterconnectGroup.QosConfiguration.Type,
"active_qos_config_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.Type,
"config_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.ConfigType,
"uplink_classification_type": logicalInterconnectGroup.QosConfiguration.ActiveQosConfig.UplinkClassificationType,
Expand Down
9 changes: 7 additions & 2 deletions versions.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

terraform {
required_version = ">= 0.12"
required_version = ">= 0.13"
required_providers {
oneview = {
source = "HewlettPackard/oneview"
version = "6.0.0-13" #Check https://registry.terraform.io/v1/providers/hewlettpackard/oneview/versions
}
}
}

0 comments on commit cefd1fa

Please sign in to comment.