If i know the system configuration, I can set set variables from the facts using:
- set_fact: drive0start={{ ansible_devices.sda.partitions.sda1.start }} register: drive0start - set_fact: drive0sectors={{ ansible_devices.sda.partitions.sda1.sectors }} register: drive0sectors - debug: msg="{{ drive0start }} {{drive0sectors }}" But what if all the systems are different, and I do not know if the drive configurations will be sda, sdb, sdc, nvem0, nvme2, etc. and I do not know how many partitions (if any) will be on each drive? Is there a way to auto detect this, and then put each start and sector value into variables to be used later? Basically loop through ansible_devices, and then loop through those drives and collect the partition start and sectors values from each, dynamically. -- 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 ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fdf9e6ee-6fdc-460b-9847-e65b633dc9cf%40googlegroups.com.