the input file format which i am using the (json/dictionary) as in below format dictionary :
{
"disks": {
"disk2": {
"name": "S",
"label": "Sample",
"disknum": 2
},
"disk3": {
"name": "T",
"label": "Testing",
"disksize": 10
},
"disk4": {
"name": "K",
"label": "Urban",
"disknum": 4
}
the code which I have used is below, but the disk number is hardcoded here in the input, which I need to replace with the values retrieved from ansible win_disk_facts,
starting disk number need to be from 2, as disk 0, disk 1 is already consumed, can we include the disk number from facts in the loop mentioned below?
- name: Perform Partition of disks
win_partition:
drive_letter: "{{item.value.name}}"
partition_size: -1
disk_number: "{{item.value.disknum}}"
loop: "{{ lookup('dict', disks) }}"
i have found out a way to resolve these 2 situations
1.increase the index value (with indexed_items)
2.use indexing value in partitioning (loop_control)