Commit 99bcbe74 by cdigiovanni

Add the uuid of the device in ansible_mounts variable

parent 115684d2
...@@ -795,6 +795,13 @@ class LinuxHardware(Hardware): ...@@ -795,6 +795,13 @@ class LinuxHardware(Hardware):
size_available = statvfs_result.f_bsize * (statvfs_result.f_bavail) size_available = statvfs_result.f_bsize * (statvfs_result.f_bavail)
except OSError, e: except OSError, e:
continue continue
lsblkPath = module.get_bin_path("lsblk")
rc, out, err = module.run_command("%s -ln --output UUID %s" % (lsblkPath, fields[0]), use_unsafe_shell=True)
if rc == 0:
uuid = out.strip()
else:
uuid = 'NA'
self.facts['mounts'].append( self.facts['mounts'].append(
{'mount': fields[1], {'mount': fields[1],
...@@ -804,6 +811,7 @@ class LinuxHardware(Hardware): ...@@ -804,6 +811,7 @@ class LinuxHardware(Hardware):
# statvfs data # statvfs data
'size_total': size_total, 'size_total': size_total,
'size_available': size_available, 'size_available': size_available,
'uuid': uuid,
}) })
def get_device_facts(self): def get_device_facts(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment