check for file system before mount

316 views
Skip to first unread message

Mark Olliver

unread,
Jul 1, 2014, 5:04:32 PM7/1/14
to ansible...@googlegroups.com
Hi,

I have a file system that is present on some servers but not others /dev/sdb, what is the best way to automatically format this disk if is is currently not formatted and then mount it to /data. If the device does not exist then which should not attempt to format it or mount it and if the device exists and is already formatted then we should just mount it?

Thanks

Mark

Brian Coca

unread,
Jul 1, 2014, 6:33:41 PM7/1/14
to ansible...@googlegroups.com
ansible facts contain your mounted filesystems and your block devices, you can examine the facts per each server, look under ansible_devices.​
Reply all
Reply to author
Forward
0 new messages