Hey All,
Trying to create a (when: ) condition, where a task runs only when a mount point does NOT exists.
- name: format disk with ext4
filesystem: fstype=ext4 dev={{ item }}
with_items: - /dev/xvdc
when: ansible_mounts.mount doesn’t contain “/path/to/my/mount/point”
The expectation is that ansible_mounts contains 1 or more mount points.
Any ideas?
Thanks!