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] -- 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/4497f2d8-d308-4964-80b9-34342a94efefo%40googlegroups.com.