File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727 oc_worker_nodes: null
2828
2929oc_controlplane_nodes:
30- %{ if network_plugin == " kube-ovn " ~}
30+ %{ if length(controlplane_node_labels) > 0 ~}
3131 vars:
3232 node_labels:
33- "kube-ovn/role": "master"
33+ %{ for key, value in controlplane_node_labels ~}
34+ "${ key} ": "${ value} "
35+ %{ endfor ~}
3436%{ endif ~}
3537 hosts:
3638%{ for master in master_nodes ~}
@@ -39,6 +41,13 @@ oc_controlplane_nodes:
3941%{ endfor ~}
4042
4143oc_worker_nodes:
44+ %{ if length(worker_node_labels) > 0 ~}
45+ vars:
46+ node_labels:
47+ %{ for key, value in worker_node_labels ~}
48+ "${ key} ": "${ value} "
49+ %{ endfor ~}
50+ %{ endif ~}
4251 hosts:
4352%{ for worker in worker_nodes ~}
4453 ${ worker.name} :
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ resource "local_file" "ansible_inventory" {
2020 ssh_user = var.ssh_user
2121 worker_nodes = var.worker_nodes
2222 windows_nodes = var.windows_nodes
23+ controlplane_node_labels = var.controlplane_node_labels
24+ worker_node_labels = var.worker_node_labels
25+
2326 })
2427
2528 filename = " ./inventory/inventory.yaml"
Original file line number Diff line number Diff line change @@ -244,4 +244,16 @@ variable "windows_nodes" {
244244variable "use_octavia" {
245245 type = bool
246246 default = true
247- }
247+ }
248+
249+ variable "controlplane_node_labels" {
250+ type = map (string )
251+ default = {}
252+ description = " Map of Kubernetes labels to apply to control plane nodes. Keys and values are strings."
253+ }
254+
255+ variable "worker_node_labels" {
256+ type = map (string )
257+ default = {}
258+ description = " Map of Kubernetes labels to apply to worker nodes. Keys and values are strings."
259+ }
You can’t perform that action at this time.
0 commit comments