Dell provide an Ansible module to query IDRAC. You can use this to get information on the server. The example below fetches the tag.

pip3 install ansible ansible-lint
ansible-galaxy collection install git+https://github.com/dell/dellemc-openmanage-ansible-modules.git,collections
pip3 install omsdk --upgrade

---
- hosts: localhost
  tasks:
    - name: Get System Inventory
      dellemc.openmanage.idrac_system_info:
        idrac_ip: "192.168.0.1"
        idrac_user: "admin"
        idrac_password: "admin"
        validate_certs: false
      register: system_info

    - name: Debug output
      debug:
        msg: "{{ system_info.system_info.System[0].ServiceTag }}"

ansible-playbook idrac.yaml

Advertisement
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.