Skip to content

Commit a5f010c

Browse files
committed
don't tf-control FIPs in prod
1 parent fd3eef8 commit a5f010c

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

environments/prod/terraform/main.tf

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -340,33 +340,19 @@ resource "openstack_compute_instance_v2" "computes" {
340340

341341
# --- floating ips ---
342342

343-
resource "openstack_networking_floatingip_v2" "logins" {
344-
345-
for_each = var.login_names
346-
347-
pool = data.openstack_networking_network_v2.external.name
348-
address = var.login_ips[each.key]
349-
}
350-
351343
resource "openstack_compute_floatingip_associate_v2" "logins" {
352344
for_each = var.login_names
353345

354-
floating_ip = openstack_networking_floatingip_v2.logins[each.key].address
346+
floating_ip = var.login_ips[each.key]
355347
instance_id = openstack_compute_instance_v2.logins[each.key].id
356348
# networks are zero-indexed
357349
fixed_ip = openstack_compute_instance_v2.logins[each.key].network.2.fixed_ip_v4
358350

359351
}
360352

361-
resource "openstack_networking_floatingip_v2" "control" {
362-
363-
pool = data.openstack_networking_network_v2.external.name
364-
address = var.control_ip
365-
}
366-
367353
resource "openstack_compute_floatingip_associate_v2" "control" {
368354

369-
floating_ip = openstack_networking_floatingip_v2.control.address
355+
floating_ip = var.control_ip
370356
instance_id = openstack_compute_instance_v2.control.id
371357
# networks are zero-indexed
372358
fixed_ip = openstack_compute_instance_v2.control.network.2.fixed_ip_v4
@@ -380,7 +366,7 @@ resource "local_file" "hosts" {
380366
{
381367
"cluster_name": var.cluster_name
382368
"cluster_slurm_name": var.cluster_slurm_name
383-
"proxy_fip": openstack_networking_floatingip_v2.logins[var.proxy_name].address
369+
"proxy_fip": var.login_ips[var.proxy_name]
384370
"control": openstack_compute_instance_v2.control,
385371
"logins": openstack_compute_instance_v2.logins,
386372
"computes": openstack_compute_instance_v2.computes,

0 commit comments

Comments
 (0)