From 74d565addcc03f3e302718ba1363858e2968d963 Mon Sep 17 00:00:00 2001 From: Amadeuds Podvratnik Date: Thu, 27 Nov 2025 16:19:48 +0100 Subject: [PATCH] Fix: Infra nodes missing infra label. Signed-off-by: Amadeuds Podvratnik --- playbooks/7_ocp_verification.yaml | 2 ++ roles/create_control_nodes/tasks/main.yaml | 4 ++-- roles/label_infra_nodes/tasks/main.yaml | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 roles/label_infra_nodes/tasks/main.yaml diff --git a/playbooks/7_ocp_verification.yaml b/playbooks/7_ocp_verification.yaml index eb360decd..3feb751b5 100644 --- a/playbooks/7_ocp_verification.yaml +++ b/playbooks/7_ocp_verification.yaml @@ -16,3 +16,5 @@ approve_certs_cleanup: true - wait_for_cluster_operators - wait_for_install_complete + - label_infra_nodes + diff --git a/roles/create_control_nodes/tasks/main.yaml b/roles/create_control_nodes/tasks/main.yaml index ef55f0107..2f033ae9a 100644 --- a/roles/create_control_nodes/tasks/main.yaml +++ b/roles/create_control_nodes/tasks/main.yaml @@ -74,7 +74,7 @@ --noautoconsole when: env.z.high_availability == True and inventory_hostname == env.z.lpar1.hostname and env.cluster.nodes.control.vm_name[0] not in hosts_with_host_vars -- name: Create the second CoreOS control node on the first KVM host, if cluster is to be highly available. +- name: Create the second CoreOS control node on the second KVM host, if cluster is to be highly available. tags: create_control_nodes shell: | virt-install \ @@ -105,7 +105,7 @@ --noautoconsole when: env.z.high_availability == True and inventory_hostname == env.z.lpar2.hostname and env.cluster.nodes.control.vm_name[1] not in hosts_with_host_vars -- name: Create the third CoreOS control node on the first KVM host, if cluster is to be highly available. +- name: Create the third CoreOS control node on the third KVM host, if cluster is to be highly available. tags: create_control_nodes shell: | virt-install \ diff --git a/roles/label_infra_nodes/tasks/main.yaml b/roles/label_infra_nodes/tasks/main.yaml new file mode 100644 index 000000000..ccdbcb002 --- /dev/null +++ b/roles/label_infra_nodes/tasks/main.yaml @@ -0,0 +1,11 @@ +--- + +- name: 'Label infra nodes as infra' + tags: check_nodes + ansible.builtin.shell: | + set -o pipefail + oc label node $(oc get nodes | grep "^{{ node | lower }}" | awk '{print $1}') node-role.kubernetes.io/infra= --overwrite + loop: "{{ (env.cluster.nodes.infra.hostname | default([])) }}" + loop_control: + loop_var: node +