jtopjian / terraform-provider-openstack-old

OpenStack Provider for Terraform using gophercloud
12 stars 4 forks source link

DO NOT USE!

Terraform now has native OpenStack support. This repository exists only for historical reasons.

terraform-provider-openstack

This is an experimental OpenStack provider for Terraform. It is based off of the excellent work already done by haklop which can be found here. The main difference is that it works with the latest version of gophercloud and does not need to be compiled along with the entire Terraform code.

Update

This is currently on-hold. Momentum has picked up again to get an official provider into Terraform.

Warning

I have almost no knowledge of Go. This work consists of me copying copying other examples and being amazed that any of this actually works. If things look sloppy and outright wrong, they are.

Also, please be aware that this is just a fun side project for me. If you'd like to take over work in a more serious manner, by all means, go for it.

Installation

Download the provider:

$ go get github.com/jtopjian/terraform-provider-openstack

Download and install the dependencies:

$ cd $GOPATH/src/github.com/jtopjian/terraform-provider-openstack
$ godep restore

Compile it:

$ go build -o terraform-provider-openstack

Copy it to the directory you keep Terraform:

$ sudo cp terraform-provider-openstack /usr/local/bin/terraform

Usage

Provider Authentication

You can authenticate with the OpenStack cloud by either explicitly setting parameters or using an openrc-style file.

Explicit Parameters

provider "openstack" {
  identity_endpoint = "http://example.com:5000/v2.0"
  username = "jdoe"
  tenant_name = "jdoe"
  password = "password"
}

openrc-style

First, source your openrc file:

$ source openrc

Next, configure the provider in the *.tf file:

provider "openstack" { }

For more information on OpenStack openrc files, see here.

Examples

See the examples directory.

Launch

$ terraform plan
$ terraform build
$ terraform destroy

Reference and Notes

provider

Notes

Parameters

openstack_instance

Notes:

Parameters

metadata {
  foo = "bar"
  baz =" foo"
}
network {
  UUID = "94e12a2a-d692-4e6f-8e34-560e8a97ead5"
  port_id = "(neutron port-id)" # NOT TESTED
  fixed_ip = "192.168.255.20" # NOT TESTED
}

openstack_keypair

Notes

Parameters

openstack_floating_ip

Notes

Parameters

openstack_secgroup

Notes

Parameters

openstack_volume

Parameters

Credits