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 bdd2f6f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 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,18 @@
ansible.builtin.debug:
msg: "{{ bmc_firmware_version }}"

- name: Check if firmware image exists locally {{ bmc_fw_update_image.bmc }}

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.16)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.16)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.15)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.15)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.15)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.15)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.14)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.14)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.14)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.14)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.15)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.9, stable-2.15)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.14)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.14)

no-free-form

Avoid using free-form when calling module actions. (stat)

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.16)

fqcn[action-core]

Use FQCN for builtin module actions (stat).

Check failure on line 16 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.16)

no-free-form

Avoid using free-form when calling module actions. (stat)
delegate_to: localhost
stat: path="{{ bmc_fw_update_image.dir }}/{{ bmc_fw_update_image.bmc }}"
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
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 @@ -9,3 +9,4 @@ 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 bdd2f6f

Please sign in to comment.