terraform/examples/openstack-with-networking
pauljrob 47ac66f675 Fixed private_key param (#10383) 2016-11-28 16:48:58 +00:00
..
README.md examples: add OpenStack configuration with networking 2015-08-31 18:03:07 +02:00
main.tf Fixed private_key param (#10383) 2016-11-28 16:48:58 +00:00
openrc.sample examples: add OpenStack configuration with networking 2015-08-31 18:03:07 +02:00
outputs.tf Fmt all the config files 2016-09-22 11:49:09 +00:00
variables.tf Fmt all the config files 2016-09-22 11:49:09 +00:00

README.md

Basic OpenStack architecture with networking

This provides a template for running a simple architecture on an OpenStack cloud.

To simplify the example, this intentionally ignores deploying and getting your application onto the servers. However, you could do so either via provisioners and a configuration management tool, or by pre-baking configured images with Packer.

After you run terraform apply on this configuration, it will output the floating IP address assigned to the instance. After your instance started, this should respond with the default nginx web page.

First set the required environment variables for the OpenStack provider by sourcing the credentials file.

source openrc

Afterwards run with a command like this:

terraform apply \
  -var 'external_gateway=c1901f39-f76e-498a-9547-c29ba45f64df' \
  -var 'pool=public'

To get a list of usable floating IP pools run this command:

$ nova floating-ip-pool-list
+--------+
| name   |
+--------+
| public |
+--------+

To get the UUID of the external gateway run this command:

$ neutron net-show FLOATING_IP_POOL
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | c1901f39-f76e-498a-9547-c29ba45f64df |
| mtu                       | 0                                    |
| name                      | public                               |
| port_security_enabled     | True                                 |
| provider:network_type     | vxlan                                |
| provider:physical_network |                                      |
| provider:segmentation_id  | 1092                                 |
| router:external           | True                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 42b672ae-8d51-4a18-a028-ddae7859ec4c |
| tenant_id                 | 1bde0a49d2ff44ffb44e6339a8cefe3a     |
+---------------------------+--------------------------------------+