# Conditionals using Ansible\_facts.disks from the win\_disk\_facts

**URL:** <https://forum.ansible.com/t/conditionals-using-ansible-facts-disks-from-the-win-disk-facts/33327>\
**Category:** Ansible Project\
**Created:** [July 6, 2020, 10:14am UTC](https://forum.ansible.com/t/conditionals-using-ansible-facts-disks-from-the-win-disk-facts/33327 "2020-07-06T10:14:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adam\_Dyson](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@Adam\_Dyson](https://forum.ansible.com/u/Adam_Dyson)\
**Post date:** [July 6, 2020, 10:14am UTC](https://forum.ansible.com/t/conditionals-using-ansible-facts-disks-from-the-win-disk-facts/33327/1 "2020-07-06T10:14:03Z")

</div>

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]
