Use Pre-existing Floating IP for Bastion (#8214)

* use pre-existing floating IP for bastion

* document bastion_fips in readme
This commit is contained in:
Febrian Setianto
2021-11-19 17:58:52 +02:00
committed by GitHub
parent 83e0b786d4
commit f48ae18630
6 changed files with 12 additions and 2 deletions

View File

@@ -28,7 +28,7 @@ resource "openstack_networking_floatingip_v2" "k8s_node" {
}
resource "openstack_networking_floatingip_v2" "bastion" {
count = var.number_of_bastions
count = length(var.bastion_fips) > 0 ? 0 : var.number_of_bastions
pool = var.floatingip_pool
depends_on = [null_resource.dummy_dependency]
}

View File

@@ -17,5 +17,5 @@ output "k8s_nodes_fips" {
}
output "bastion_fips" {
value = openstack_networking_floatingip_v2.bastion[*].address
value = length(var.bastion_fips) > 0 ? var.bastion_fips : openstack_networking_floatingip_v2.bastion[*].address
}

View File

@@ -20,4 +20,6 @@ variable "k8s_nodes" {}
variable "k8s_master_fips" {}
variable "bastion_fips" {}
variable "router_internal_port_id" {}