Dell Raid selection using Idrac with ansible

Im trying to set up 3 x raid sets via ansible and Dell Idrac .

A raid 1 Boot drive - On Boot card
Radi 1 Livedb Drive - on SSD drives of the on Board raid controller
Raid 5 Archive - on remaining HDD drives on board raid Controller.

Im having difficulty in ID the Controllers and Drives to select

YML Script

  • name: Get RAID info from Dell R550 iDRAC
    hosts: idrac
    gather_facts: false

    vars:
    validate_certs: false
    ansible_python_interpreter: “/home/admin_nm/ansible/roles/dell/dell_env/bin/python3.12”

    tasks:

    • name: Get RAID controller and disk info
      dellemc.openmanage.idrac_storage_volume:
      idrac_ip: “{{ serv_ip }}”
      idrac_user: “{{ serv_user }}”
      idrac_password: “{{ serv_password }}”
      validate_certs: “{{ validate_certs }}”
      state: “view”
      register: store_info
      delegate_to: localhost

    • name: Show storage controller information
      debug:
      var: store_info[‘storage_status’][‘Message’][‘Controller’]

    • name: Extract controller IDs and disks
      set_fact:
      controllers_with_disks:

    • name: Append controller and disk info
      set_fact:
      controllers_with_disks: “{{ controllers_with_disks + [{‘controller_id’: item.key, ‘physical_disks’: item.value.PhysicalDisk | default()}] }}”
      loop: “{{ store_info[‘storage_status’][‘Message’][‘Controller’] | dict2items }}”

    • name: Show storage controller current ID
      debug:
      var: controllers_with_disks

Could we know what is your issue or what do you need ?
I mean you’re pasting your yaml code without any result/error code or something.
Sorry but it’s tough to guess your needs..

Moreover, there’s a whole example that seems to do what you need here :

This is what the code returns - Im trying to find all Controlled with Disks I know the RAID.SL.3-1 Has 4 20TB HDD’s and 2 SSD’s on it but will not list.

Im trying to automate the raid setup for the raids.

the AHCI is the Boss Card. - it will be the main Boot drive. (raid 1)

TASK [Show storage controller current ID] ***************************************************************************************************************************task path: /home/admin_nm/ansible/roles/dell/Raid_info.yml:37
ok: [idrac-G84KF14-HQ-seccam02] => {
“controllers_with_disks”: [
{
“controller_id”: “RAID.SL.3-1”,
“physical_disks”:
},
{
“controller_id”: “AHCI.Embedded.1-1”,
“physical_disks”:
},
{
“controller_id”: “AHCI.Embedded.2-1”,
“physical_disks”:
},
{
“controller_id”: “AHCI.SL.10-1”,
“physical_disks”: [
“Disk.Direct.0-0:AHCI.SL.10-1”,
“Disk.Direct.1-1:AHCI.SL.10-1”
]
}
]
}