Skip to content

Commit

Permalink
feat(bmc_fw_update): compare version with filename
Browse files Browse the repository at this point in the history
This is instead of comparing before and after version

Fixes #22

Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Feb 26, 2024
1 parent ec8ce40 commit 08d92e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions roles/bmc_fw_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
ansible.builtin.debug:
msg: "{{ bmc_firmware_version }}"

- name: Validate fw image changed from before
ansible.builtin.assert:
that:
- get_bmc_facts_before.redfish_facts.firmware.entries[0].Version != get_bmc_facts_after.redfish_facts.firmware.entries[0].Version
- name: Validate fw image matches given filename
ansible.builtin.fail:
msg: "checking..."
when: not bmc_fw_update_image.bmc is search(bmc_firmware_version | regex_search('[0-9-.]+'))
2 changes: 1 addition & 1 deletion roles/get_bmc_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

- name: Extract BMC firmware version from inventory
ansible.builtin.set_fact:
bmc_firmware_version: "{{ result.redfish_facts.firmware | community.general.json_query('entries[?Id==`BMC_Firmware`].Version') }}"
bmc_firmware_version: "{{ result.redfish_facts.firmware | community.general.json_query('entries[?Id==`BMC_Firmware`].Version') | first }}"

0 comments on commit 08d92e0

Please sign in to comment.