Skip to content

Commit 3ef69bf

Browse files
committed
feat(iac): Fix to include server in nodes output
1 parent 2c72db0 commit 3ef69bf

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

deployment/terraform/modules/openstack-kubernetes-infra/networking.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
locals {
4-
devops_controller_cidr = "${local.controller_host_instance.access_ip_v4}/32"
4+
devops_controller_cidr = "${local.controller_host_instance.ip_address}/32"
55

66
cogstack_apps_ingress_rules = [
77
{ port = 22, cidr = var.allowed_ingress_ips_cidr, description = "Expose SSH" },

deployment/terraform/modules/openstack-kubernetes-infra/outputs.tf

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11

22
output "created_hosts" {
3-
value = { for k, value in merge(openstack_compute_instance_v2.kubernetes_nodes, [openstack_compute_instance_v2.kubernetes_server]) : k => {
3+
value = merge({ for k, value in openstack_compute_instance_v2.kubernetes_nodes : k => {
44
ip_address = value.access_ip_v4
55
unique_name = value.name
66
name = k
7-
} }
7+
} },
8+
{
9+
(local.controller_host.name) : local.controller_host_instance
10+
})
811

912
description = "Created Hosts: A map of { hostname: { data } }"
1013
}
1114

1215
output "created_controller_host" {
13-
value = {
14-
name = (local.controller_host.name)
15-
ip_address = local.controller_host_instance.access_ip_v4
16-
unique_name = local.controller_host_instance.name
17-
}
18-
16+
value = local.controller_host_instance
1917
description = "Created Controller Host: A map of { hostname: { data } }"
2018
}
2119

deployment/terraform/modules/openstack-kubernetes-infra/shared-locals.tf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ locals {
66

77
locals {
88
controller_host = one([for host in var.host_instances : host if host.is_controller])
9-
controller_host_instance = openstack_compute_instance_v2.kubernetes_server
9+
created_controller_host = openstack_compute_instance_v2.kubernetes_server
10+
controller_host_instance = {
11+
name = local.controller_host.name
12+
ip_address = local.created_controller_host.access_ip_v4
13+
unique_name = local.created_controller_host.name
14+
}
1015
}
1116

1217
locals {

0 commit comments

Comments
 (0)