Skip to content

Commit

Permalink
fix: pass inventory name as argument
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Mar 22, 2024
1 parent bab1e8d commit 1571035
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
41 changes: 41 additions & 0 deletions docs/bmc_fw_update_role.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,47 @@ Parameters
URL of the BMC fw image. Ignored if bmc\_fw\_update\_image\_file exists.


.. rst-class:: ansible-option-line

:ansible-option-default-bold:`Default:` :ansible-option-default:`"True"`

.. raw:: html

</div>

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--bmc_fw_update_inventory_name"></div>

.. _ansible_collections.opi.dpu.bmc_fw_update_role__parameter-main__bmc_fw_update_inventory_name:

.. rst-class:: ansible-option-title

**bmc_fw_update_inventory_name**

.. raw:: html

<a class="ansibleOptionLink" href="#parameter-main--bmc_fw_update_inventory_name" title="Permalink to this option"></a>

.. ansible-option-type-line::

:ansible-option-type:`string`




.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

Inventory component name returned from the server to access via disctionary as key.


.. rst-class:: ansible-option-line

:ansible-option-default-bold:`Default:` :ansible-option-default:`"True"`
Expand Down
1 change: 1 addition & 0 deletions roles/bmc_fw_update/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

bmc_fw_update_reboot: true
bmc_fw_update_job_wait: true
bmc_fw_update_inventory_name: bmc_firmware
bmc_fw_update_image_file: /tmp/bf3-bmc-24.01-5_opn.fwpkg
bmc_fw_update_image_url: https://content.mellanox.com/BlueField/BMC/24.01-5-Jan-2024/{{ bmc_fw_update_image_file | basename }}
5 changes: 5 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,11 @@ argument_specs:
- Packages that do not require a reboot are applied immediately irrespective of I (reboot).
type: bool
default: true
bmc_fw_update_inventory_name:
description:
- Inventory component name returned from the server to access via disctionary as key.
type: str
default: true
bmc_fw_update_image_url:
description:
- URL of the BMC fw image. Ignored if bmc_fw_update_image_file exists.
Expand Down
6 changes: 5 additions & 1 deletion roles/bmc_fw_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
name: get_bmc_facts
register: get_bmc_facts_before

- name: Store current fw version
ansible.builtin.set_fact:
bmc_fw_update_cur_fw_version: "{{ vars.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}"

- name: Print BMC Version
ansible.builtin.debug:
msg: "{{ get_bmc_facts_all_fw_versions }}"
Expand Down Expand Up @@ -87,7 +91,7 @@

- name: Store fw version we installed
ansible.builtin.set_fact:
bmc_fw_update_got_fw_version: "{{ vars.get_bmc_facts_all_fw_versions['bmc_firmware'] }}"
bmc_fw_update_got_fw_version: "{{ vars.get_bmc_facts_all_fw_versions[bmc_fw_update_inventory_name] }}"

- name: Validate fw image matches given filename
ansible.builtin.fail:
Expand Down

0 comments on commit 1571035

Please sign in to comment.