2017-12-05 12:48:47 +00:00
|
|
|
resource "null_resource" "dummy_dependency" {
|
2019-08-18 08:30:05 +00:00
|
|
|
triggers = {
|
2017-12-05 12:48:47 +00:00
|
|
|
dependency_id = "${var.router_id}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "openstack_networking_floatingip_v2" "k8s_master" {
|
2018-01-05 11:09:04 +00:00
|
|
|
count = "${var.number_of_k8s_masters}"
|
|
|
|
pool = "${var.floatingip_pool}"
|
|
|
|
depends_on = ["null_resource.dummy_dependency"]
|
2017-12-05 12:48:47 +00:00
|
|
|
}
|
|
|
|
|
2019-04-29 05:58:20 +00:00
|
|
|
resource "openstack_networking_floatingip_v2" "k8s_master_no_etcd" {
|
|
|
|
count = "${var.number_of_k8s_masters_no_etcd}"
|
|
|
|
pool = "${var.floatingip_pool}"
|
|
|
|
depends_on = ["null_resource.dummy_dependency"]
|
|
|
|
}
|
|
|
|
|
2017-12-05 12:48:47 +00:00
|
|
|
resource "openstack_networking_floatingip_v2" "k8s_node" {
|
2018-01-05 11:09:04 +00:00
|
|
|
count = "${var.number_of_k8s_nodes}"
|
|
|
|
pool = "${var.floatingip_pool}"
|
|
|
|
depends_on = ["null_resource.dummy_dependency"]
|
2017-12-05 12:48:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "openstack_networking_floatingip_v2" "bastion" {
|
2018-01-05 11:09:04 +00:00
|
|
|
count = "${var.number_of_bastions}"
|
|
|
|
pool = "${var.floatingip_pool}"
|
|
|
|
depends_on = ["null_resource.dummy_dependency"]
|
2017-12-05 12:48:47 +00:00
|
|
|
}
|
2020-04-16 14:52:45 +00:00
|
|
|
|
|
|
|
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"]
|
|
|
|
}
|
|
|
|
|