Test on ansible facts sda size

Can someone point me in the right direction

ansible_devices[‘sda’][‘size’] returns “X GB”

How can I use a when statement to perform something

when: x> variable

Do I need to convert “X GB” to a number

Can someone point me in the right direction

ansible_devices['sda']['size'] returns "X GB"

How can I use a when statement to perform something

when: x> variable

Do I need to convert "X GB" to a number

yes, to a float to be precise.

try something like this:

when: ansible_devices['sda'].size.split(' ')[0]|float > 18

Thanks, That works great