From 479b4cdf73fd20d3a957862784481593019e8b8d Mon Sep 17 00:00:00 2001 From: Jakub Darmach Date: Fri, 27 Sep 2024 11:51:00 +0200 Subject: [PATCH] Get the list of ironic nodes - use correct scope Use correct system scope - all - while getting the list of ironic nodes in ipa-images role. Closes-Bug: #2083014 Change-Id: I4da3a3739d57817ffbd094caea0fc80c3ad8eff8 --- ansible/roles/ipa-images/tasks/set-driver-info.yml | 11 +++++++++-- .../bug-2083014-set-driver-info-86ff04d3d32cdb8c.yaml | 7 +++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/bug-2083014-set-driver-info-86ff04d3d32cdb8c.yaml diff --git a/ansible/roles/ipa-images/tasks/set-driver-info.yml b/ansible/roles/ipa-images/tasks/set-driver-info.yml index f6d937832..4592da109 100644 --- a/ansible/roles/ipa-images/tasks/set-driver-info.yml +++ b/ansible/roles/ipa-images/tasks/set-driver-info.yml @@ -20,12 +20,19 @@ set_fact: ipa_images_ramdisk_uuid: "{{ ipa_images_glance.results[1].images[0].id }}" +- name: Change system scope to all for Ironic operations + set_fact: + ipa_images_ironic_openstack_auth_env: "{{ ipa_images_openstack_auth_env | + combine ({ 'OS_PROJECT_NAME': omit }) | + combine ({ 'OS_PROJECT_DOMAIN_NAME': omit }) | + combine ({ 'OS_SYSTEM_SCOPE': 'all' }) }}" + - name: Get a list of ironic nodes command: | {{ ipa_images_venv }}/bin/openstack baremetal node list --fields name uuid driver_info -f json register: ipa_images_ironic_node_list changed_when: False - environment: "{{ ipa_images_openstack_auth_env }}" + environment: "{{ ipa_images_ironic_openstack_auth_env }}" - name: Make sure openstack nodes are in baremetal-compute group add_host: @@ -59,4 +66,4 @@ when: item["Driver Info"].deploy_kernel != ipa_images_kernel_uuid or item["Driver Info"].deploy_ramdisk != ipa_images_ramdisk_uuid - environment: "{{ ipa_images_openstack_auth_env }}" + environment: "{{ ipa_images_ironic_openstack_auth_env }}" diff --git a/releasenotes/notes/bug-2083014-set-driver-info-86ff04d3d32cdb8c.yaml b/releasenotes/notes/bug-2083014-set-driver-info-86ff04d3d32cdb8c.yaml new file mode 100644 index 000000000..9bc5bbab1 --- /dev/null +++ b/releasenotes/notes/bug-2083014-set-driver-info-86ff04d3d32cdb8c.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes an issue where task 'ensure ironic nodes use the new Ironic + Python Agent (IPA) images` fails with 'dict object' has no + attribute 'deploy_kernel'. + `__.