terraform: Use Neutron floating IPs

Use openstack_networking_floatingip_v2 instead of
openstack_compute_floatingip_v2 to make use of
Neutron floating IPs in the Terraform example.

Also update the .gitignore to ignore the terraform
DB which is generated.

Signed-off-by: Kyle Mestery <mestery@mestery.com>
This commit is contained in:
Kyle Mestery 2016-01-03 10:24:09 -06:00
parent e8145d7818
commit e28946d2b3
4 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View file

@ -7,3 +7,4 @@
.vagrant
real-adminrc
*.taskpaper
terraform/tf-example/terraform.tfstate*

View file

@ -22,7 +22,7 @@ resource "openstack_networking_router_interface_v2" "tf-router-interface" {
subnet_id = "${openstack_networking_subnet_v2.tf-subnet.id}"
}
resource "openstack_compute_floatingip_v2" "tf-fip" {
resource "openstack_networking_floatingip_v2" "tf-fip" {
pool = "${var.pool}"
depends_on = ["openstack_networking_router_interface_v2.tf-router-interface"]
}
@ -33,7 +33,7 @@ resource "openstack_compute_instance_v2" "tf-instance" {
flavor_name = "${var.flavor}"
key_pair = "${var.key_pair}"
security_groups = ["default"]
floating_ip = "${openstack_compute_floatingip_v2.tf-fip.address}"
floating_ip = "${openstack_networking_floatingip_v2.tf-fip.address}"
network {
uuid = "${openstack_networking_network_v2.tf-net.id}"
}

View file

@ -1,3 +1,3 @@
output "address" {
value = "${openstack_compute_floatingip_v2.tf-fip.address}"
value = "${openstack_networking_floatingip_v2.tf-fip.address}"
}

View file

@ -2,5 +2,5 @@ provider "openstack" {
user_name = "demo"
tenant_name = "demo"
password = "password"
auth_url = "http://openstack.domain.net:5000/v2.0"
auth_url = "http://192.168.33.101:5000/v2.0"
}