Skip to content

Commit

Permalink
fix(bmc_fw_update): move vars to argument_specs
Browse files Browse the repository at this point in the history
Fixed #37

Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Feb 28, 2024
1 parent d559304 commit c812050
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions roles/bmc_fw_update/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

bmc_fw_update_reboot: true
bmc_fw_update_job_wait: true
bmc_fw_update_image_url: https://content.mellanox.com/BlueField/BMC/23.10-1-oct-2023/bf3-bmc-23.10-5_opn.fwpkg
bmc_fw_update_image_file: /tmp/bf3-bmc-23.10-5_opn.fwpkg
10 changes: 10 additions & 0 deletions roles/bmc_fw_update/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ argument_specs:
- Packages that do not require a reboot are applied immediately irrespective of I (reboot).
type: bool
default: true
bmc_fw_update_image_url:
description:
- URL of the BMC fw image. Ignored if bmc_fw_update_image_file exists.
type: str
default: true
bmc_fw_update_image_file:
description:
- Local file of the BMC fw image, if exists bmc_fw_update_image_url is ignored.
type: str
default: true
bmc_fw_update_job_wait:
description: Whether to wait for job completion or not.
type: bool
Expand Down
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 @@ -13,10 +13,10 @@
ansible.builtin.debug:
msg: "{{ bmc_firmware_version }}"

- name: Download firmware image {{ bmc_fw_update_image.bmc }}
- name: Download firmware image {{ bmc_fw_update_image_url }}
ansible.builtin.get_url:
url: "{{ bmc_fw_update_image.url }}/{{ bmc_fw_update_image.bmc }}"
dest: /tmp/{{ bmc_fw_update_image.bmc }}
url: "{{ bmc_fw_update_image_url }}"
dest: "{{ bmc_fw_update_image_file }}"
mode: '0440'
delegate_to: localhost

Expand All @@ -28,7 +28,7 @@
username: "{{ dpu_bmc_username }}"
password: "{{ dpu_bmc_password }}"
timeout: 600
update_image_file: "/tmp/{{ bmc_fw_update_image.bmc }}"
update_image_file: "{{ bmc_fw_update_image_file }}"
register: result_update_task
delegate_to: localhost

Expand Down
4 changes: 0 additions & 4 deletions roles/bmc_fw_update/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@
# vars file for bmc_fw_update

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

0 comments on commit c812050

Please sign in to comment.