Terraform/OpenStack: Allow free form worker node definition (#5952)

* Terraform/OpenStack: Allow free form worker node definition

* fixup! Terraform/OpenStack: Allow free form worker node definition
This commit is contained in:
qvicksilver
2020-04-16 16:52:45 +02:00
committed by GitHub
parent 35f248dff0
commit 065292f8a4
8 changed files with 264 additions and 4 deletions

View File

@@ -27,3 +27,10 @@ resource "openstack_networking_floatingip_v2" "bastion" {
pool = "${var.floatingip_pool}"
depends_on = ["null_resource.dummy_dependency"]
}
resource "openstack_networking_floatingip_v2" "k8s_nodes" {
for_each = var.number_of_k8s_nodes == 0 ? { for key, value in var.k8s_nodes : key => value if value.floating_ip } : {}
pool = "${var.floatingip_pool}"
depends_on = ["null_resource.dummy_dependency"]
}

View File

@@ -10,6 +10,10 @@ output "k8s_node_fips" {
value = "${openstack_networking_floatingip_v2.k8s_node[*].address}"
}
output "k8s_nodes_fips" {
value = "${openstack_networking_floatingip_v2.k8s_nodes}"
}
output "bastion_fips" {
value = "${openstack_networking_floatingip_v2.bastion[*].address}"
}

View File

@@ -14,4 +14,6 @@ variable "network_name" {}
variable "router_id" {
default = ""
}
}
variable "k8s_nodes" {}