Skip to content

Commit bf3263b

Browse files
Merge pull request #794 from russellb/openstack-network-uuid
openstack: Support setting network UUID via terraform variable.
2 parents 13d1158 + 8d0847c commit bf3263b

File tree

6 files changed

+42
-10
lines changed

6 files changed

+42
-10
lines changed

data/data/openstack/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ module "masters" {
6868
module "topology" {
6969
source = "./topology"
7070

71-
cidr_block = "${var.machine_cidr}"
72-
cluster_id = "${var.cluster_id}"
73-
external_network = "${var.openstack_external_network}"
74-
masters_count = "${var.master_count}"
75-
lb_floating_ip = "${var.openstack_lb_floating_ip}"
76-
trunk_support = "${var.openstack_trunk_support}"
71+
cidr_block = "${var.machine_cidr}"
72+
cluster_id = "${var.cluster_id}"
73+
external_network = "${var.openstack_external_network}"
74+
external_network_id = "${var.openstack_external_network_id}"
75+
masters_count = "${var.master_count}"
76+
lb_floating_ip = "${var.openstack_lb_floating_ip}"
77+
trunk_support = "${var.openstack_trunk_support}"
7778
}
7879

7980
resource "openstack_objectstorage_container_v1" "container" {

data/data/openstack/topology/private-network.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ resource "openstack_networking_port_v2" "service_port" {
7676
}
7777

7878
data "openstack_networking_network_v2" "external_network" {
79-
name = "${var.external_network}"
80-
external = true
79+
name = "${var.external_network}"
80+
network_id = "${var.external_network_id}"
81+
external = true
8182
}
8283

8384
resource "openstack_networking_floatingip_associate_v2" "service_fip" {

data/data/openstack/topology/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ variable "cluster_id" {
77
}
88

99
variable "external_network" {
10+
description = "Name of the external network providing Floating IP addresses."
11+
type = "string"
12+
default = ""
13+
}
14+
15+
variable "external_network_id" {
1016
description = "UUID of the external network providing Floating IP addresses."
1117
type = "string"
1218
default = ""

data/data/openstack/variables-openstack.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,21 @@ variable "openstack_external_network" {
194194
type = "string"
195195
default = ""
196196

197+
description = <<EOF
198+
(optional) Name of the external network. The network is used to provide
199+
Floating IP access to the deployed nodes. Optional, but either the Name
200+
or UUID option must be specified.
201+
EOF
202+
}
203+
204+
variable "openstack_external_network_id" {
205+
type = "string"
206+
default = ""
207+
197208
description = <<EOF
198209
(optional) UUID of the external network. The network is used to provide
199-
Floating IP access to the deployed nodes.
210+
Floating IP access to the deployed nodes. Optional, but either the Name
211+
or UUID option must be specified.
200212
EOF
201213
}
202214

docs/user/openstack/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ api VM:
274274

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

277+
## Disambiguating the External Network
278+
279+
The installer assumes that the name of the external network is unique. In case
280+
there is more than one network with the same name as the desired external
281+
network, it’s possible to provide a UUID to specify which network should be
282+
used.
283+
284+
```
285+
$ env TF_VAR_openstack_external_network_id="6a32627e-d98d-40d8-9324-5da7cf1452fc" \
286+
> bin/openshift-install create cluster
287+
```
288+
277289
## Troubleshooting
278290

279291
See the [troubleshooting installer issues in OpenStack](./troubleshooting.md) guide.

pkg/types/openstack/platform.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type Platform struct {
1717
Cloud string `json:"cloud"`
1818

1919
// ExternalNetwork
20-
// The OpenStack external network to be used for installation.
20+
// The OpenStack external network name to be used for installation.
2121
ExternalNetwork string `json:"externalNetwork"`
2222

2323
// FlavorName

0 commit comments

Comments
 (0)