Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions data/data/openstack/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ module "masters" {
module "topology" {
source = "./topology"

cidr_block = "${var.machine_cidr}"
cluster_id = "${var.cluster_id}"
external_network = "${var.openstack_external_network}"
masters_count = "${var.master_count}"
lb_floating_ip = "${var.openstack_lb_floating_ip}"
trunk_support = "${var.openstack_trunk_support}"
cidr_block = "${var.machine_cidr}"
cluster_id = "${var.cluster_id}"
external_network = "${var.openstack_external_network}"
external_network_id = "${var.openstack_external_network_id}"
masters_count = "${var.master_count}"
lb_floating_ip = "${var.openstack_lb_floating_ip}"
trunk_support = "${var.openstack_trunk_support}"
}

resource "openstack_objectstorage_container_v1" "container" {
Expand Down
5 changes: 3 additions & 2 deletions data/data/openstack/topology/private-network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ resource "openstack_networking_port_v2" "service_port" {
}

data "openstack_networking_network_v2" "external_network" {
name = "${var.external_network}"
external = true
name = "${var.external_network}"
network_id = "${var.external_network_id}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if someone "accidentally" sets both, name and id, and these 2 don't correspond to the same network? Will neutron fail or will it give precedence to the id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know for sure since I haven't tested it, but I think terraform will fail because it won't be able to find a network that matches that name + UUID. I do know that setting both works, if you set them properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did test this. Terraform will fail because it can't find a matching network with that name + UUID.

external = true
}

resource "openstack_networking_floatingip_associate_v2" "service_fip" {
Expand Down
6 changes: 6 additions & 0 deletions data/data/openstack/topology/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ variable "cluster_id" {
}

variable "external_network" {
description = "Name of the external network providing Floating IP addresses."
type = "string"
default = ""
}

variable "external_network_id" {
description = "UUID of the external network providing Floating IP addresses."
type = "string"
default = ""
Expand Down
14 changes: 13 additions & 1 deletion data/data/openstack/variables-openstack.tf
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,21 @@ variable "openstack_external_network" {
type = "string"
default = ""

description = <<EOF
(optional) Name of the external network. The network is used to provide
Floating IP access to the deployed nodes. Optional, but either the Name
or UUID option must be specified.
EOF
}

variable "openstack_external_network_id" {
type = "string"
default = ""

description = <<EOF
(optional) UUID of the external network. The network is used to provide
Floating IP access to the deployed nodes.
Floating IP access to the deployed nodes. Optional, but either the Name
or UUID option must be specified.
EOF
}

Expand Down
12 changes: 12 additions & 0 deletions docs/user/openstack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,18 @@ api VM:

* `openstack server delete <cluster name>-api`

## Disambiguating the External Network

The installer assumes that the name of the external network is unique. In case
there is more than one network with the same name as the desired external
network, it’s possible to provide a UUID to specify which network should be
used.

```
$ env TF_VAR_openstack_external_network_id="6a32627e-d98d-40d8-9324-5da7cf1452fc" \
> bin/openshift-install create cluster
```

## Troubleshooting

See the [troubleshooting installer issues in OpenStack](./troubleshooting.md) guide.
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/openstack/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Platform struct {
Cloud string `json:"cloud"`

// ExternalNetwork
// The OpenStack external network to be used for installation.
// The OpenStack external network name to be used for installation.
ExternalNetwork string `json:"externalNetwork"`

// FlavorName
Expand Down