1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

filesystem: Ignore blkid cache

Sometimes, `blkid` will incorrectly return no information about a block
device, even if it exists and has a valid filesystem. This causes the
*filesystem* module to fail if *force=no*. Instructing `blkid` to use
`/dev/null` as a cache file will force it to rescan the block device on
each run, making results more consistent.

Signed-off-by: Dustin C. Hatch <admiralnemo@gmail.com>
This commit is contained in:
Dustin C. Hatch 2014-02-25 20:08:57 -06:00
parent 6ed48b5ad7
commit 467914e3c3

View file

@ -79,7 +79,7 @@ def main():
cmd = module.get_bin_path('blkid', required=True) cmd = module.get_bin_path('blkid', required=True)
rc,raw_fs,err = module.run_command("%s -o value -s TYPE %s" % (cmd, dev)) rc,raw_fs,err = module.run_command("%s -c /dev/null -o value -s TYPE %s" % (cmd, dev))
fs = raw_fs.strip() fs = raw_fs.strip()