diff --git a/docs/bmc_fw_update_role.rst b/docs/bmc_fw_update_role.rst index a9e2d40..6c055b3 100644 --- a/docs/bmc_fw_update_role.rst +++ b/docs/bmc_fw_update_role.rst @@ -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 + + + + * - .. raw:: html + +
+
+ + .. _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 + + + + .. ansible-option-type-line:: + + :ansible-option-type:`string` + + + + + .. raw:: html + +
+ + - .. raw:: html + +
+ + 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"` diff --git a/roles/bmc_fw_update/defaults/main.yml b/roles/bmc_fw_update/defaults/main.yml index 5234dff..8de1cd2 100644 --- a/roles/bmc_fw_update/defaults/main.yml +++ b/roles/bmc_fw_update/defaults/main.yml @@ -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 }} diff --git a/roles/bmc_fw_update/meta/argument_specs.yml b/roles/bmc_fw_update/meta/argument_specs.yml index bdfe10b..09857a9 100644 --- a/roles/bmc_fw_update/meta/argument_specs.yml +++ b/roles/bmc_fw_update/meta/argument_specs.yml @@ -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. diff --git a/roles/bmc_fw_update/tasks/main.yml b/roles/bmc_fw_update/tasks/main.yml index 188c94d..e9ab636 100644 --- a/roles/bmc_fw_update/tasks/main.yml +++ b/roles/bmc_fw_update/tasks/main.yml @@ -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 }}" @@ -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: