Extend mount info (#81768)

pull/81784/head
Hungtsetse 9 months ago committed by GitHub
parent 230f956e25
commit 51f2ddd445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- "Add ``dump`` and ``passno`` mount information to facts component (https://github.com/ansible/ansible/issues/80478)"

@ -556,6 +556,7 @@ class LinuxHardware(Hardware):
fields = [self._replace_octal_escapes(field) for field in fields]
device, mount, fstype, options = fields[0], fields[1], fields[2], fields[3]
dump, passno = int(fields[4]), int(fields[5])
if not device.startswith(('/', '\\')) and ':/' not in device or fstype == 'none':
continue
@ -563,7 +564,9 @@ class LinuxHardware(Hardware):
mount_info = {'mount': mount,
'device': device,
'fstype': fstype,
'options': options}
'options': options,
'dump': dump,
'passno': passno}
if mount in bind_mounts:
# only add if not already there, we might have a plain /etc/mtab

@ -73,12 +73,14 @@ class TestFactsLinuxHardwareGetMountFacts(unittest.TestCase):
'block_total': 105871006,
'block_used': 5713133,
'device': '/dev/mapper/fedora_dhcp129--186-home',
'dump': 0,
'fstype': 'ext4',
'inode_available': 26860880,
'inode_total': 26902528,
'inode_used': 41648,
'mount': '/home',
'options': 'rw,seclabel,relatime,data=ordered',
'passno': 0,
'size_available': 410246647808,
'size_total': 433647640576,
'uuid': 'N/A'}

Loading…
Cancel
Save