Conditionals using Ansible_facts.disks from the win_disk_facts

Hello world!

Hopefully a relatively simple one, I am attempting to add a when condition on a task that will only happen if a certain disk exists on the machine. I want the following task to only take place if Ansible facts finds a disk with the number 4. however I am struggling to find the right syntax. Has anyone done this and know the answer?

  • name: Create Partition
    win_partition:
    drive_letter:F
    partition_size: ‘-1’
    Disk_Number: 4
    state: present
    when:
  • Ansible_facts.disks[4]