Peter Whall 2 weeks ago committed by GitHub
commit b76ccf1d1c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,3 @@
---
bugfixes:
- freebsd - update disk and slices regex for fact gathering (https://github.com/ansible/ansible/pull/82081).

@ -173,8 +173,41 @@ class FreeBSDHardware(Hardware):
sysdir = '/dev'
device_facts['devices'] = {}
drives = re.compile(r'(ada?\d+|da\d+|a?cd\d+)') # TODO: rc, disks, err = self.module.run_command("/sbin/sysctl kern.disks")
slices = re.compile(r'(ada?\d+s\d+\w*|da\d+s\d+\w*)')
# TODO: rc, disks, err = self.module.run_command("/sbin/sysctl kern.disks")
drives = re.compile(
r"""(
ada?\d+| # ATA/SATA disk device
da\d+| # SCSI disk device
a?cd\d+| # SCSI CDROM drive
amrd\d+| # AMI MegaRAID drive
idad\d+| # Compaq RAID array
ipsd\d+| # IBM ServeRAID RAID array
md\d+| # md(4) disk device
mfid\d+| # LSI MegaRAID SAS array
mlxd\d+| # Mylex RAID disk
twed\d+| # 3ware ATA RAID array
vtbd\d+ # VirtIO Block Device
)
"""
)
slice = re.compile(
r"""(
ada?\d+[ps]\d+\w*| # ATA/SATA disk device
a?cd\d+[ps]\d+\w*| # SCSI CDROM drive
amrd\d+[ps]\d+\w*| # AMI MegaRAID drive
da\d+[ps]\d+\w*| # SCSI disk device
idad\d+[ps]\d+\w*| # Compaq RAID array
ipsd\d+[ps]\d+\w*| # IBM ServeRAID RAID array
md\d+[ps]\d+\w*| # md(4) disk device
mfid\d+[ps]\d+\w*| # LSI MegaRAID SAS array
mlxd\d+[ps]\d+\w*| # Mylex RAID disk
twed\d+[ps]\d+\w*| # 3ware ATA RAID array
vtbd\d+[ps]\d+\w* # VirtIO Block Device
)
"""
)
if os.path.isdir(sysdir):
dirlist = sorted(os.listdir(sysdir))
for device in dirlist:

Loading…
Cancel
Save