diff options
author | Robin Roth <robin.roth@kit.edu> | 2016-11-03 08:53:10 +0100 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-11-03 10:52:07 -0700 |
commit | 6ca6a9a2919d03bd5935472d4f0c3e3ab5b3c28b (patch) | |
tree | e062a25ade36886b4a48d047b3d60575613296ba | |
parent | 7ff9942ec6db86430210f21ca9ba0ff1844cce15 (diff) | |
download | ansible-6ca6a9a2919d03bd5935472d4f0c3e3ab5b3c28b.tar.gz |
Exclude floppy disks from lsblk call for uuids
Fixes #18326
-rw-r--r-- | lib/ansible/module_utils/facts.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 183b1a82e6..d171513fcd 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -1228,7 +1228,11 @@ class LinuxHardware(Hardware): self.facts[k] = 'NA' def _run_lsblk(self, lsblk_path): - args = ['--list', '--noheadings', '--paths', '--output', 'NAME,UUID'] + # call lsblk and collect all uuids + # --exclude 2 makes lsblk ignore floppy disks, which are slower to answer than typical timeouts + # this uses the linux major device number + # for details see https://www.kernel.org/doc/Documentation/devices.txt + args = ['--list', '--noheadings', '--paths', '--output', 'NAME,UUID', '--exclude', '2'] cmd = [lsblk_path] + args rc, out, err = self.module.run_command(cmd) return rc, out, err |