Skip to content

Commit

Permalink
feat(get_bmc_facts): introduce new var
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Mar 1, 2024
1 parent eb61c45 commit 16afa08
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 0 deletions.
143 changes: 143 additions & 0 deletions docs/get_bmc_facts_role.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@

.. Document meta
:orphan:

.. |antsibull-internal-nbsp| unicode:: 0xA0
:trim:

.. meta::
:antsibull-docs: 2.7.0

.. Anchors
.. _ansible_collections.opi.dpu.get_bmc_facts_role:

.. Title
opi.dpu.get_bmc_facts role -- Fetch DPU firmware inventory.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

.. Collection note
.. note::
This role is part of the `opi.dpu collection <https://galaxy.ansible.com/ui/repo/published/opi/dpu/>`_ (version 1.0.0).

It is not included in ``ansible-core``.
To check whether it is installed, run :code:`ansible-galaxy collection list`.

To install it use: :code:`ansible-galaxy collection install opi.dpu`.

To use it in a playbook, specify: :code:`opi.dpu.get_bmc_facts`.

.. contents::
:local:
:depth: 2


.. Entry point title
Entry point ``main`` -- Fetch DPU firmware inventory.
-----------------------------------------------------

.. version_added
.. rst-class:: ansible-version-added

New in opi.dpu 1.0.0

.. Deprecated
Synopsis
^^^^^^^^

.. Description
- Fetch DPU firmware inventory and store in facts.

.. Requirements
.. Options
Parameters
^^^^^^^^^^

.. tabularcolumns:: \X{1}{3}\X{2}{3}

.. list-table::
:width: 100%
:widths: auto
:header-rows: 1
:class: longtable ansible-option-table

* - Parameter
- Comments

* - .. raw:: html

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

.. _ansible_collections.opi.dpu.get_bmc_facts_role__parameter-main__get_bmc_facts_component_id:

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

**get_bmc_facts_component_id**

.. raw:: html

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

.. ansible-option-type-line::

:ansible-option-type:`string`




.. raw:: html

</div>

- .. raw:: html

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

FW componenet ID name to fetch.


.. raw:: html

</div>


.. Attributes
.. Notes
.. Seealso
.. Extra links
Collection links
~~~~~~~~~~~~~~~~

.. ansible-links::

- title: "Issue Tracker"
url: "https://github.com/opiproject/ansible-opi-dpu/issues"
external: true
- title: "Repository (Sources)"
url: "https://github.com/opiproject/ansible-opi-dpu"
external: true


.. Parsing errors
2 changes: 2 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ Role Index
These are the roles in the opi.dpu collection:

* :ansplugin:`bmc_fw_update role <opi.dpu.bmc_fw_update#role>` -- Firmware update of DPU BMC
* :ansplugin:`get_bmc_facts role <opi.dpu.get_bmc_facts#role>` -- Fetch DPU firmware inventory.
* :ansplugin:`update_bmc_password role <opi.dpu.update_bmc_password#role>` -- Update Password of DPU BMC for a given user.

.. toctree::
:maxdepth: 1
:hidden:

bmc_fw_update_role
get_bmc_facts_role
update_bmc_password_role

5 changes: 5 additions & 0 deletions roles/get_bmc_facts/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.

---
# defaults file for get_bmc_facts

get_bmc_facts_component_id: "BMC_Firmware"

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file

Check failure on line 7 in roles/get_bmc_facts/defaults/main.yml

View workflow job for this annotation

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

yaml[new-line-at-end-of-file]

No new line character at the end of file
13 changes: 13 additions & 0 deletions roles/get_bmc_facts/meta/argument_specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2022-2024 Dell Inc, or its subsidiaries.
---
argument_specs:
main:
version_added: "1.0.0"
short_description: Fetch DPU firmware inventory.
description:
- Fetch DPU firmware inventory and store in facts.
options:
get_bmc_facts_component_id:
type: str
description: FW componenet ID name to fetch.
1 change: 1 addition & 0 deletions roles/get_bmc_facts/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

- name: Extract BMC firmware version from inventory
ansible.builtin.set_fact:
# TODO: use get_bmc_facts_component_id here
bmc_firmware_version: "{{ result.redfish_facts.firmware | community.general.json_query('entries[?Id==`BMC_Firmware`].Version') | first }}"

0 comments on commit 16afa08

Please sign in to comment.