Skip to content

Commit 4f1d278

Browse files
slagleamartyasinha
authored andcommitted
[reproducer] Pass libvirt layout to controller-0 for correct boot mode detection
When generate_bm_info.yml runs on controller-0, it needs access to _cifmw_libvirt_manager_layout to determine the correct boot_mode based on the VM's uefi configuration. Since configure_controller.yml uses delegate_facts: false, the layout fact wasn't available on controller-0, causing boot_mode to always default to 'legacy' even for UEFI VMs. This fix explicitly passes the layout from the hypervisor's hostvars to make it available for the delegated tasks, ensuring VMs with nvram are correctly identified as UEFI boot mode in baremetal-info.yml. Also fixes the regex in reproducer/tasks/generate_bm_info.yml to set the _type var and match hostnames that are like: cifmw-compute-wcl4866c-0 Assisted-By: Claude Jira: OSPRH-22373 Signed-off-by: James Slagle <jslagle@redhat.com>
1 parent 1f01109 commit 4f1d278

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

roles/reproducer/tasks/configure_controller.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
delegate_to: controller-0
1212
delegate_facts: false
1313
vars:
14+
# Pass the layout from hypervisor to controller-0 so generate_bm_info.yml
15+
# can access the uefi field to set correct boot_mode in baremetal-info.yml
16+
_cifmw_libvirt_manager_layout: >-
17+
{{ hostvars[inventory_hostname]._cifmw_libvirt_manager_layout }}
1418
cifmw_sushy_emulator_hypervisor_target: "{{ inventory_hostname }}"
1519
cifmw_sushy_emulator_install_type: podman
1620
cifmw_sushy_emulator_hypervisor_address: >-

roles/reproducer/tasks/generate_bm_info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
}}
8080
_host: "{{ item.key | replace('cifmw-', '') }}"
8181
_uefi: >-
82-
{% set _type = _host | regex_replace('-[0-9]+$', '') -%}
82+
{% set _type = _host | regex_replace('(-[a-z0-9]+)+$', '') -%}
8383
{{ _cifmw_libvirt_manager_layout.vms[_type].uefi | default(false) | bool }}
8484
_data: |
8585
"{{ _host }}":

0 commit comments

Comments
 (0)