I use the ansible filesystem module to format the data disks of a newly provisioned database cluster.
- name: Format data disk
community.general.filesystem:
fstype: ext4
dev: /dev/sdc
...
But what I want is a way to automatically ckeck before formatting to make sure it doesn't run if the disk is already formatted, although I noticed that the module seems to do that checking on every run but I'm still not sure of its behavior.
Any thoughts?