Skip to content

Commit ab3f44d

Browse files
committed
Merge remote-tracking branch 'origin/main' into ci/enable-linting
2 parents 4e68527 + c94d134 commit ab3f44d

File tree

7 files changed

+43
-3
lines changed

7 files changed

+43
-3
lines changed

environments/site/tofu/additional.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module "additional" {
3535
security_group_ids = lookup(each.value, "security_group_ids", [for o in data.openstack_networking_secgroup_v2.nonlogin : o.id])
3636
additional_cloud_config = lookup(each.value, "additional_cloud_config", var.additional_cloud_config)
3737
additional_cloud_config_vars = lookup(each.value, "additional_cloud_config_vars", var.additional_cloud_config_vars)
38+
server_group_id = lookup(each.value, "server_group_id", null)
3839

3940
# can't be set for additional nodes
4041
compute_init_enable = []
@@ -68,6 +69,7 @@ module "additional" {
6869
"nodename_template",
6970
"security_group_ids",
7071
"additional_cloud_config",
71-
"additional_cloud_config_vars"
72+
"additional_cloud_config_vars",
73+
"server_group_id"
7274
]
7375
}

environments/site/tofu/compute.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module "compute" {
3434
match_ironic_node = lookup(each.value, "match_ironic_node", null)
3535
availability_zone = lookup(each.value, "availability_zone", null)
3636
ip_addresses = lookup(each.value, "ip_addresses", null)
37+
server_group_id = lookup(each.value, "server_group_id", null)
3738

3839
# computed
3940
# not using openstack_compute_instance_v2.control.access_ip_v4 to avoid
@@ -63,7 +64,8 @@ module "compute" {
6364
"gateway_ip",
6465
"nodename_template",
6566
"additional_cloud_config",
66-
"additional_cloud_config_vars"
67+
"additional_cloud_config_vars",
68+
"server_group_id"
6769
]
6870

6971
}

environments/site/tofu/control.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ resource "openstack_compute_instance_v2" "control" {
7272
}
7373
}
7474

75+
dynamic "scheduler_hints" {
76+
for_each = var.control_server_group_id != null ? [true] : []
77+
content {
78+
group = var.control_server_group_id
79+
}
80+
}
81+
7582
metadata = {
7683
environment_root = var.environment_root
7784
access_ip = openstack_networking_port_v2.control[var.cluster_networks[0].network].all_fixed_ips[0]

environments/site/tofu/login.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ module "login" {
3434
match_ironic_node = lookup(each.value, "match_ironic_node", null)
3535
availability_zone = lookup(each.value, "availability_zone", null)
3636
ip_addresses = lookup(each.value, "ip_addresses", null)
37+
server_group_id = lookup(each.value, "server_group_id", null)
3738

3839
# can't be set for login
3940
compute_init_enable = []
@@ -68,7 +69,8 @@ module "login" {
6869
"nodename_template",
6970
"additional_cloud_config",
7071
"additional_cloud_config_vars",
71-
"security_group_ids"
72+
"security_group_ids",
73+
"server_group_id"
7274
]
7375

7476
}

environments/site/tofu/node_group/nodes.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ resource "openstack_compute_instance_v2" "compute_fixed_image" {
103103
}
104104
}
105105

106+
dynamic "scheduler_hints" {
107+
for_each = var.server_group_id != null ? [true] : []
108+
content {
109+
group = var.server_group_id
110+
}
111+
}
112+
106113
metadata = merge(
107114
{
108115
environment_root = var.environment_root
@@ -164,6 +171,13 @@ resource "openstack_compute_instance_v2" "compute" {
164171
}
165172
}
166173

174+
dynamic "scheduler_hints" {
175+
for_each = var.server_group_id != null ? [true] : []
176+
content {
177+
group = var.server_group_id
178+
}
179+
}
180+
167181
metadata = merge(
168182
{
169183
environment_root = var.environment_root

environments/site/tofu/node_group/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,8 @@ variable "additional_cloud_config_vars" {
209209
default = {}
210210
nullable = false
211211
}
212+
213+
variable "server_group_id" {
214+
type = string
215+
default = null
216+
}

environments/site/tofu/variables.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ variable "login" {
8484
if match_ironic_node is true, defered to OpenStack otherwise
8585
gateway_ip: Address to add default route via
8686
nodename_template: Overrides variable cluster_nodename_template
87+
server_group_id: String ID of server group to use for scheduler hint
8788
EOF
8889

8990
type = any
@@ -129,6 +130,7 @@ variable "compute" {
129130
if match_ironic_node is true, defered to OpenStack otherwise
130131
gateway_ip: Address to add default route via
131132
nodename_template: Overrides variable cluster_nodename_template
133+
server_group_id: String ID of server group to use for scheduler hint
132134
133135
Nodes are added to the following inventory groups:
134136
- $group_name
@@ -341,3 +343,9 @@ variable "additional_cloud_config_vars" {
341343
type = map(any)
342344
default = {}
343345
}
346+
347+
variable "control_server_group_id" {
348+
description = "ID of server group to use for control node scheduler hint"
349+
type = string
350+
default = null
351+
}

0 commit comments

Comments
 (0)