From 539f0db74e764dba84f87a355fc19f7f83539fab Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 24 Jul 2017 16:02:13 -0700 Subject: [PATCH] examples: remove openstack example This has now moved into the openstack provider repository, linked from the README here. --- examples/README.md | 1 + examples/openstack-with-networking/README.md | 63 -------------- examples/openstack-with-networking/main.tf | 85 ------------------- .../openstack-with-networking/openrc.sample | 7 -- examples/openstack-with-networking/outputs.tf | 3 - .../openstack-with-networking/variables.tf | 21 ----- 6 files changed, 1 insertion(+), 179 deletions(-) delete mode 100644 examples/openstack-with-networking/README.md delete mode 100644 examples/openstack-with-networking/main.tf delete mode 100644 examples/openstack-with-networking/openrc.sample delete mode 100644 examples/openstack-with-networking/outputs.tf delete mode 100644 examples/openstack-with-networking/variables.tf diff --git a/examples/README.md b/examples/README.md index 49cafd8f5..b5137ab4d 100644 --- a/examples/README.md +++ b/examples/README.md @@ -24,3 +24,4 @@ repositories contain documentation specific to their provider: * [Consul Examples](https://github.com/terraform-providers/terraform-provider-consul/tree/master/examples) * [DigitalOcean Examples](https://github.com/terraform-providers/terraform-provider-digitalocean/tree/master/examples) * [Google Cloud Examples](https://github.com/terraform-providers/terraform-provider-google/tree/master/examples) +* [OpenStack Examples](https://github.com/terraform-providers/terraform-provider-openstack/tree/master/examples) diff --git a/examples/openstack-with-networking/README.md b/examples/openstack-with-networking/README.md deleted file mode 100644 index 2f9d381ca..000000000 --- a/examples/openstack-with-networking/README.md +++ /dev/null @@ -1,63 +0,0 @@ -# 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](https://www.terraform.io/docs/provisioners/) and a configuration -management tool, or by pre-baking configured images with -[Packer](http://www.packer.io). - -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](http://docs.openstack.org/cli-reference/content/cli_openrc.html). - -``` -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 | -+---------------------------+--------------------------------------+ -``` diff --git a/examples/openstack-with-networking/main.tf b/examples/openstack-with-networking/main.tf deleted file mode 100644 index 25ddb6972..000000000 --- a/examples/openstack-with-networking/main.tf +++ /dev/null @@ -1,85 +0,0 @@ -resource "openstack_compute_keypair_v2" "terraform" { - name = "terraform" - public_key = "${file("${var.ssh_key_file}.pub")}" -} - -resource "openstack_networking_network_v2" "terraform" { - name = "terraform" - admin_state_up = "true" -} - -resource "openstack_networking_subnet_v2" "terraform" { - name = "terraform" - network_id = "${openstack_networking_network_v2.terraform.id}" - cidr = "10.0.0.0/24" - ip_version = 4 - dns_nameservers = ["8.8.8.8", "8.8.4.4"] -} - -resource "openstack_networking_router_v2" "terraform" { - name = "terraform" - admin_state_up = "true" - external_gateway = "${var.external_gateway}" -} - -resource "openstack_networking_router_interface_v2" "terraform" { - router_id = "${openstack_networking_router_v2.terraform.id}" - subnet_id = "${openstack_networking_subnet_v2.terraform.id}" -} - -resource "openstack_compute_secgroup_v2" "terraform" { - name = "terraform" - description = "Security group for the Terraform example instances" - - rule { - from_port = 22 - to_port = 22 - ip_protocol = "tcp" - cidr = "0.0.0.0/0" - } - - rule { - from_port = 80 - to_port = 80 - ip_protocol = "tcp" - cidr = "0.0.0.0/0" - } - - rule { - from_port = -1 - to_port = -1 - ip_protocol = "icmp" - cidr = "0.0.0.0/0" - } -} - -resource "openstack_compute_floatingip_v2" "terraform" { - pool = "${var.pool}" - depends_on = ["openstack_networking_router_interface_v2.terraform"] -} - -resource "openstack_compute_instance_v2" "terraform" { - name = "terraform" - image_name = "${var.image}" - flavor_name = "${var.flavor}" - key_pair = "${openstack_compute_keypair_v2.terraform.name}" - security_groups = ["${openstack_compute_secgroup_v2.terraform.name}"] - floating_ip = "${openstack_compute_floatingip_v2.terraform.address}" - - network { - uuid = "${openstack_networking_network_v2.terraform.id}" - } - - provisioner "remote-exec" { - connection { - user = "${var.ssh_user_name}" - private_key = "${file(var.ssh_key_file)}" - } - - inline = [ - "sudo apt-get -y update", - "sudo apt-get -y install nginx", - "sudo service nginx start", - ] - } -} diff --git a/examples/openstack-with-networking/openrc.sample b/examples/openstack-with-networking/openrc.sample deleted file mode 100644 index c9a38e0a1..000000000 --- a/examples/openstack-with-networking/openrc.sample +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -export OS_AUTH_URL=http://KEYSTONE.ENDPOINT.URL:5000/v2.0 -export OS_TENANT_NAME=YOUR_TENANT_NAME -export OS_USERNAME=YOUR_USERNAME -export OS_PASSWORD=YOUR_PASSWORD -export OS_REGION_NAME=YOUR_REGION_NAME diff --git a/examples/openstack-with-networking/outputs.tf b/examples/openstack-with-networking/outputs.tf deleted file mode 100644 index 8ff1f75a7..000000000 --- a/examples/openstack-with-networking/outputs.tf +++ /dev/null @@ -1,3 +0,0 @@ -output "address" { - value = "${openstack_compute_floatingip_v2.terraform.address}" -} diff --git a/examples/openstack-with-networking/variables.tf b/examples/openstack-with-networking/variables.tf deleted file mode 100644 index c24a6958a..000000000 --- a/examples/openstack-with-networking/variables.tf +++ /dev/null @@ -1,21 +0,0 @@ -variable "image" { - default = "Ubuntu 14.04" -} - -variable "flavor" { - default = "m1.small" -} - -variable "ssh_key_file" { - default = "~/.ssh/id_rsa.terraform" -} - -variable "ssh_user_name" { - default = "ubuntu" -} - -variable "external_gateway" {} - -variable "pool" { - default = "public" -}