You get a useful subset of DMI info already parsed into facts
<https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/facts/hardware/linux.py#L303>
by the setup module, for example running `ansible -m setup localhost` could
give you:

        "ansible_bios_vendor": "LENOVO",
        "ansible_bios_version": "x.y.z",
        "ansible_board_asset_tag": "Not Available",
        "ansible_board_name": "xxxxxxxxxxxxxx",
        "ansible_board_serial": "xxxxxxxxxxxxxx",
        "ansible_board_vendor": "LENOVO",
        "ansible_board_version": "Not Defined",
        "ansible_chassis_asset_tag": "No Asset Information",
        "ansible_chassis_serial": "xxxxxxxxxxxxxx",
        "ansible_chassis_vendor": "LENOVO",
        "ansible_chassis_version": "None",

You could use a custom fact or two set based on dmidecode or the included
setup facts to toggle the hardware vendor and then use their appropriate
LOM tooling CLIs or any REST API interfaces provided if you needed to dig
deeper. (As Klaas has mentioned Dell iDRAC, Lenovo LOM or CMM)

Look at what others have done in this space, for example
https://newrelic.com/blog/best-practices/ansible-auditing-tool (or
https://github.com/redhat-cop/canary, which was used for application
fingerprinting but again could prove useful examples.)

Finally, the dmidecode binary directly will give you much of the info
you're looking for although it's not going to be the easiest thing to parse.




On Wed, 16 Nov 2022 at 19:26, Klaas Demter <[email protected]> wrote:

> For dell you can get these types of information from the idrac if it's
> configured.
>
>
> https://docs.ansible.com/ansible/latest/collections/dellemc/openmanage/index.html
>
> the idrac* modules.
>
>
> On 11/16/22 18:38, Linux Study wrote:
>
> I mean . If there is lenovo or dell servers.how can we get details like
> bios version, mac address, firm version etc . Via ansible playbook?
>
>
> Regards,
> Abhi
>
>
>
>
> On Tue, 15 Nov 2022, 17:55 'Rowe, Walter P. (Fed)' via Ansible Project, <
> [email protected]> wrote:
>
>> Ansible needs to have SSH access to the Linux machine with an ID that can
>> sudo to root.
>>
>> Walter
>> --
>> Walter Rowe, Division Chief
>> Infrastructure Services, OISM
>> Mobile: 202.355.4123
>>
>> On Nov 15, 2022, at 1:00 AM, Dick Visser <[email protected]> wrote:
>>
>> What do you mean with pre-checks?
>> Ansible is an automation tool, so how do you currently get those
>> pre-checks?
>>
>>
>> On Mon, 14 Nov 2022 at 19:20, Linux Study <[email protected]> wrote:
>>
>>> Hi All,
>>>
>>> Can someone please help me to get pre-checks from Lenovo physical
>>> servers via ansible-playbook? Someone has a sample playbook that can help
>>> me...
>>>
>>>
>>> Regards,
>>> Abhi
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Ansible Project" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/CAEcjLFzfXs5FnsWyMr1cLmXAeG8_RQ0s5yQyHMzy1hzGdu_sRQ%40mail.gmail.com
>>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAEcjLFzfXs5FnsWyMr1cLmXAeG8_RQ0s5yQyHMzy1hzGdu_sRQ%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C7d9a3a953ca64fb510ec08dac6cebe20%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638040888533363116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=u72GHAXyrKc5thvfXbCN%2FDMDQ3dZqXKoslAmNoXoEsk%3D&reserved=0>
>>> .
>>>
>> --
>> Sent from Gmail Mobile
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAF8BbLbi8%2BdX1364A8PshFzxq_hdjSePs_rq%3DMCafDMNfnLQzg%40mail.gmail.com
>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCAF8BbLbi8%252BdX1364A8PshFzxq_hdjSePs_rq%253DMCafDMNfnLQzg%2540mail.gmail.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C7d9a3a953ca64fb510ec08dac6cebe20%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638040888533363116%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Um1tCBI%2Fr%2B1EJ7h4n4G7pbSFuZexgdQTDEqNv0cmSDA%3D&reserved=0>
>> .
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/FE222C58-8F7F-4607-B164-F3E2660BC609%40nist.gov
>> <https://groups.google.com/d/msgid/ansible-project/FE222C58-8F7F-4607-B164-F3E2660BC609%40nist.gov?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAEcjLFwBfF%2BE0hLEq4x9b79u_TAUpjKXwixZ1f_RWv9-5sw8pA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAEcjLFwBfF%2BE0hLEq4x9b79u_TAUpjKXwixZ1f_RWv9-5sw8pA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/98623cc7-dfc9-40cb-d373-177c64ba77ec%40gmail.com
> <https://groups.google.com/d/msgid/ansible-project/98623cc7-dfc9-40cb-d373-177c64ba77ec%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAKtKohToNQQ%3Dqn43shtx1rmp8Sed-mNFDmvjMoMaSNkqMH_wLw%40mail.gmail.com.

Reply via email to