Skip to content

Commit

Permalink
feat(bmc_fw_update): skip download if local file exists
Browse files Browse the repository at this point in the history
Fixes #16

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

- name: Check if firmware image exists locally {{ bmc_fw_update_image.bmc }}
ansible.builtin.stat:
path: "{{ bmc_fw_update_image.dir }}/{{ bmc_fw_update_image.bmc }}"
delegate_to: localhost
register: bmc_fw_update_local_file_check

- name: Download firmware image {{ bmc_fw_update_image.bmc }}
ansible.builtin.get_url:
url: "{{ bmc_fw_update_image.url }}/{{ bmc_fw_update_image.bmc }}"
dest: /tmp/{{ bmc_fw_update_image.bmc }}
dest: "{{ bmc_fw_update_image.dir }}"
mode: '0440'
delegate_to: localhost
when: not bmc_fw_update_local_file_check.stat.exists

- name: Update BMC firmware of DPU
community.general.redfish_command:
Expand Down
2 changes: 1 addition & 1 deletion roles/bmc_fw_update/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ bmc_fw_update_task_failure: "Task failed with status: %s"
bmc_fw_update_image:
url: https://content.mellanox.com/BlueField/BMC/23.10-1-oct-2023
bmc: bf3-bmc-23.10-5_opn.fwpkg
cec: cec1736-ecfw-00.02.0152.0000-n02-rel-prod.fwpkg
dir: /tmp

0 comments on commit 2ad72f3

Please sign in to comment.