Skip to content

Commit 54809f0

Browse files
committed
add missing additional nodegroup file
1 parent 25af907 commit 54809f0

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
module "additional" {
2+
source = "./node_group"
3+
4+
for_each = var.additional_nodegroups
5+
6+
# must be set for group:
7+
nodes = each.value.nodes
8+
flavor = each.value.flavor
9+
10+
# always taken from top-level value:
11+
cluster_name = var.cluster_name
12+
cluster_domain_suffix = var.cluster_domain_suffix
13+
key_pair = var.key_pair
14+
environment_root = var.environment_root
15+
16+
# can be set for group, defaults to top-level value:
17+
image_id = lookup(each.value, "image_id", var.cluster_image_id)
18+
vnic_types = lookup(each.value, "vnic_types", var.vnic_types)
19+
volume_backed_instances = lookup(each.value, "volume_backed_instances", var.volume_backed_instances)
20+
root_volume_size = lookup(each.value, "root_volume_size", var.root_volume_size)
21+
root_volume_type = lookup(each.value, "root_volume_type", var.root_volume_type)
22+
gateway_ip = lookup(each.value, "gateway_ip", var.gateway_ip)
23+
nodename_template = lookup(each.value, "nodename_template", var.cluster_nodename_template)
24+
25+
# optionally set for group:
26+
networks = concat(var.cluster_networks, lookup(each.value, "extra_networks", []))
27+
# here null means "use module var default"
28+
extra_volumes = lookup(each.value, "extra_volumes", null)
29+
fip_addresses = lookup(each.value, "fip_addresses", null)
30+
fip_network = lookup(each.value, "fip_network", null)
31+
match_ironic_node = lookup(each.value, "match_ironic_node", null)
32+
availability_zone = lookup(each.value, "availability_zone", null)
33+
ip_addresses = lookup(each.value, "ip_addresses", null)
34+
35+
# can't be set for additional nodes
36+
compute_init_enable = []
37+
ignore_image_changes = false
38+
39+
# computed
40+
# not using openstack_compute_instance_v2.control.access_ip_v4 to avoid
41+
# updates to node metadata on deletion/recreation of the control node:
42+
control_address = openstack_networking_port_v2.control[var.cluster_networks[0].network].all_fixed_ips[0]
43+
security_group_ids = [for o in data.openstack_networking_secgroup_v2.nonlogin: o.id]
44+
baremetal_nodes = data.external.baremetal_nodes.result
45+
46+
# input dict validation:
47+
group_name = each.key
48+
group_keys = keys(each.value)
49+
allowed_keys = [
50+
"nodes",
51+
"flavor",
52+
"image_id",
53+
"extra_networks",
54+
"vnic_types",
55+
"volume_backed_instances",
56+
"root_volume_size",
57+
"root_volume_type",
58+
"extra_volumes",
59+
"fip_addresses",
60+
"fip_network",
61+
"match_ironic_node",
62+
"availability_zone",
63+
"ip_addresses",
64+
"gateway_ip",
65+
"nodename_template",
66+
]
67+
}

0 commit comments

Comments
 (0)