Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bmc_fw_update): compare version with filename #35

Merged
merged 1 commit into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: "{{ bmc_fw_update_version_failure }}"
when: not bmc_fw_update_image.bmc is search(bmc_firmware_version | regex_search('[0-9-.]+'))
1 change: 1 addition & 0 deletions roles/bmc_fw_update/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# vars file for bmc_fw_update

bmc_fw_update_task_failure: "Task failed with status: %s"
bmc_fw_update_version_failure: "Version returned from BMC doesn't match version in the file name"
bmc_fw_update_image:
url: https://content.mellanox.com/BlueField/BMC/23.10-1-oct-2023
bmc: bf3-bmc-23.10-5_opn.fwpkg
Expand Down
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 }}"
Loading