From 79ed04fa18af87fa3bc3f9b512836c75d96d8f00 Mon Sep 17 00:00:00 2001 From: Samuel Rac Date: Tue, 25 Aug 2026 09:24:54 +0100 Subject: [PATCH] [update] Allow selecting NodeSets for compute reboot Allow callers to supply the NodeSets used by the reboot deployment. When unset, continue discovering every NodeSet in the namespace. Signed-off-by: Samuel Rac --- .../tasks/reboot_hypervisor_using_cr.yml | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/roles/update/tasks/reboot_hypervisor_using_cr.yml b/roles/update/tasks/reboot_hypervisor_using_cr.yml index 3d753930a..5aaf57ce9 100644 --- a/roles/update/tasks/reboot_hypervisor_using_cr.yml +++ b/roles/update/tasks/reboot_hypervisor_using_cr.yml @@ -1,5 +1,6 @@ --- - name: Fetch NodeSets for the Reboot OpenStackDataPlaneDeployment + when: cifmw_update_node_sets is not defined environment: KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" @@ -8,9 +9,21 @@ oc -n {{ cifmw_update_namespace }} get openstackdataplanenodeset -o name | awk -F'/' '{print $2}' - register: cifmw_update_node_sets + register: _cifmw_update_node_sets_fetch changed_when: false +- name: Set cifmw_update_node_sets from fetch result + when: _cifmw_update_node_sets_fetch is not skipped + ansible.builtin.set_fact: + cifmw_update_node_sets: >- + {{ + _cifmw_update_node_sets_fetch.stdout + | split('\n') + | map('trim') + | reject('equalto', '') + | list + }} + - name: Construct the Reboot CR name ansible.builtin.set_fact: cifmw_reboot_dep_name: >- @@ -32,12 +45,7 @@ name: "{{ cifmw_reboot_dep_name }}" namespace: "{{ cifmw_update_namespace }}" spec: - nodeSets: "{{ cifmw_update_node_sets.stdout - | split('\n') - | map('trim') - | reject('equalto', '') - | list - }}" + nodeSets: "{{ cifmw_update_node_sets }}" servicesOverride: - reboot-os ansibleExtraVars: