From 14313c48c7c45e23135075bd770543e6c30c267a Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:09:54 +0100 Subject: [PATCH 1/8] [inherit_parent_scenario] Fix loop variable type for Ansible 2.16 Convert _file_list to YAML to ensure loop receives a list type instead of string. Ansible 2.16+ enforces strict type checking for loop values. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- ci/playbooks/tasks/inherit_parent_scenario.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/playbooks/tasks/inherit_parent_scenario.yml b/ci/playbooks/tasks/inherit_parent_scenario.yml index 7928c6e7ed..3f36545369 100644 --- a/ci/playbooks/tasks/inherit_parent_scenario.yml +++ b/ci/playbooks/tasks/inherit_parent_scenario.yml @@ -27,4 +27,4 @@ - item is exists ansible.builtin.include_vars: file: "{{ item }}" - loop: "{{ _file_list }}" + loop: "{{ _file_list | from_yaml }}" From eb252670485d530655741b81892787566e6ec0cd Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:09:59 +0100 Subject: [PATCH 2/8] [install_ca] Fix conditional expressions to return boolean Wrap Jinja2 variable assignments in proper template syntax to ensure conditionals evaluate to boolean values. Ansible 2.16+ requires explicit boolean results in when clauses. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/install_ca/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/install_ca/tasks/main.yml b/roles/install_ca/tasks/main.yml index 9c5c0cbab6..27ecfceb08 100644 --- a/roles/install_ca/tasks/main.yml +++ b/roles/install_ca/tasks/main.yml @@ -53,9 +53,9 @@ - name: Update ca bundle vars: - _ca_bundle_changed: ca_bundle is defined and ca_bundle is changed - _ca_inline_changed: ca_inline is defined and ca_inline is changed - _ca_url_changed: cifmw_install_ca_url is defined + _ca_bundle_changed: "{{ ca_bundle is defined and ca_bundle is changed }}" + _ca_inline_changed: "{{ ca_inline is defined and ca_inline is changed }}" + _ca_url_changed: "{{ cifmw_install_ca_url is defined }}" when: - _ca_url_changed or _ca_bundle_changed or _ca_inline_changed ansible.builtin.command: From 11a8ecf1aec3d1a3c95dd42bc82cfa710b7ec21e Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:04 +0100 Subject: [PATCH 3/8] [dnsmasq] Fix ipaddr filter to return boolean in conditional Use ternary filter to convert ansible.utils.ipaddr result to explicit boolean. Ansible 2.16+ requires conditionals to evaluate to true/false, not truthy/falsy values. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/dnsmasq/tasks/manage_address.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/dnsmasq/tasks/manage_address.yml b/roles/dnsmasq/tasks/manage_address.yml index 5b539b8bcf..56e2d5b49b 100644 --- a/roles/dnsmasq/tasks/manage_address.yml +++ b/roles/dnsmasq/tasks/manage_address.yml @@ -11,7 +11,7 @@ that: - item.state is defined - item.state in ['present', 'absent'] - - item.ipaddr is undefined or (item.ipaddr is defined and (item.ipaddr | ansible.utils.ipaddr)) + - item.ipaddr is undefined or (item.ipaddr is defined and ((item.ipaddr | ansible.utils.ipaddr) | ternary(true, false))) - item.domains is defined - (item.domains | type_debug) == "list" loop: "{{ cifmw_dnsmasq_address }}" From 03cf1b3e2709e5be7ae0aa7cb373ccfee74b1b30 Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:09 +0100 Subject: [PATCH 4/8] [libvirt_manager] Fix range type for loop variable Add list filter to range() output to ensure loop receives a proper list type. Ansible 2.16+ does not support range objects directly as loop values. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/libvirt_manager/tasks/volumes.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/libvirt_manager/tasks/volumes.yml b/roles/libvirt_manager/tasks/volumes.yml index 736ff5177f..2a196b12c6 100644 --- a/roles/libvirt_manager/tasks/volumes.yml +++ b/roles/libvirt_manager/tasks/volumes.yml @@ -35,7 +35,7 @@ {{ [cifmw_libvirt_manager_ocp_pool_dir, _vol_name] | path_join }} - loop: "{{ range(0, vol_num | int) }}" + loop: "{{ range(0, vol_num | int) | list }}" loop_control: index_var: vol_id label: "{{ vol_prefix }}-vol-{{ vol_id }}" @@ -80,7 +80,7 @@ {% endif %} --capacity {{ vol_size }} --format {{ vol_format | default('qcow2') }} - loop: "{{ range(0, vol_num | int) }}" + loop: "{{ range(0, vol_num | int) | list }}" loop_control: index_var: vol_id label: "{{ vol_prefix }}-vol-{{ vol_id }}" @@ -92,7 +92,7 @@ dest: "{{ _pool_dir }}/{{ vol_prefix }}-vol-{{ vol_id }}.xml" src: "attach-volume.xml.j2" mode: "0644" - loop: "{{ range(0, vol_num | int) }}" + loop: "{{ range(0, vol_num | int) | list }}" loop_control: index_var: vol_id label: "{{ vol_prefix }}-vol-{{ vol_id }}" From ea292abf535b25a0e64c59065b8a0aa2f7f16df7 Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:13 +0100 Subject: [PATCH 5/8] [config_drive] Fix conditional to handle None type properly Replace truthy check with explicit 'is not none' and length check. Ansible 2.16+ requires conditionals to return boolean values, not NoneType. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/config_drive/tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/config_drive/tasks/main.yml b/roles/config_drive/tasks/main.yml index 67b38d8c59..38bb10b1c4 100644 --- a/roles/config_drive/tasks/main.yml +++ b/roles/config_drive/tasks/main.yml @@ -63,7 +63,8 @@ register: _net_data_change when: - cifmw_config_drive_networkconfig is defined - - cifmw_config_drive_networkconfig + - cifmw_config_drive_networkconfig is not none + - cifmw_config_drive_networkconfig | length > 0 ansible.builtin.template: backup: true src: "network-config.j2" From fec35635648bd4c8959411c32d015d576aec9591 Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:23 +0100 Subject: [PATCH 6/8] [sushy_emulator] Fix list handling for VM instances Remove regex replacement that converted list to string format. The variable should remain as a list for proper loop iteration in Ansible 2.16+. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/sushy_emulator/tasks/collect_details.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sushy_emulator/tasks/collect_details.yml b/roles/sushy_emulator/tasks/collect_details.yml index e54aa6ccb7..d5b7ec997a 100644 --- a/roles/sushy_emulator/tasks/collect_details.yml +++ b/roles/sushy_emulator/tasks/collect_details.yml @@ -105,7 +105,7 @@ {% endfor -%} {{ matching_vms }} ansible.builtin.set_fact: - _cifmw_sushy_emulator_instances: "{{ _matching_vms | regex_replace('\n(?!.*\n)', ', ')}}" + _cifmw_sushy_emulator_instances: "{{ _matching_vms }}" when: - _matching_vms | length > 0 From 678738483d6d4edec1ece021fd0fafe0a91674ef Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:28 +0100 Subject: [PATCH 7/8] [reproducer] Fix conditional to handle undefined variable Use default(false) and bool filter to ensure conditional returns boolean even when variable is undefined. Ansible 2.16+ does not allow NoneType in conditional evaluation. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- roles/reproducer/tasks/generate_bm_info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/reproducer/tasks/generate_bm_info.yml b/roles/reproducer/tasks/generate_bm_info.yml index 45d9df72d8..50fd603a6b 100644 --- a/roles/reproducer/tasks/generate_bm_info.yml +++ b/roles/reproducer/tasks/generate_bm_info.yml @@ -123,7 +123,7 @@ mode: "0644" - name: Output ironic_nodes to file - when: cifmw_reproducer_ironic_node_name_prefix + when: cifmw_reproducer_ironic_node_name_prefix | default(false) | bool ansible.builtin.copy: dest: "{{ cifmw_basedir }}/parameters/ironic_nodes.yaml" content: | From a75de77c8827fb8b265c8f099a607ccbaf7caf8d Mon Sep 17 00:00:00 2001 From: Sergii Golovatiuk Date: Fri, 5 Dec 2025 13:10:34 +0100 Subject: [PATCH 8/8] [va-hci] Add compute VM variable defaults Define cifmw_libvirt_manager_compute_* variables explicitly to prevent template evaluation errors during fact gathering. When the scenario overrides cifmw_libvirt_manager_configuration, Ansible evaluates Jinja2 expressions before va-common.yml variables are in scope. Co-Authored-By: Claude Signed-off-by: Sergii Golovatiuk --- scenarios/reproducers/va-hci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scenarios/reproducers/va-hci.yml b/scenarios/reproducers/va-hci.yml index ae40dc1f91..6a9ae7ce52 100644 --- a/scenarios/reproducers/va-hci.yml +++ b/scenarios/reproducers/va-hci.yml @@ -1,6 +1,12 @@ --- cifmw_parent_scenario: "scenarios/reproducers/va-hci-base.yml" +# Define compute VM settings (required when overriding cifmw_libvirt_manager_configuration) +cifmw_libvirt_manager_compute_amount: 3 +cifmw_libvirt_manager_compute_disksize: 50 +cifmw_libvirt_manager_compute_memory: 8 +cifmw_libvirt_manager_compute_cpus: 4 + # HERE if you want to override kustomization, you can uncomment this parameter # and push the data structure you want to apply. # cifmw_architecture_user_kustomize: