mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add some more OpenBSD facts
added: * ansible_distribution * ansible_distribution_release * ansible_distribution_version
This commit is contained in:
parent
a563ea1340
commit
2f887c6dca
1 changed files with 9 additions and 0 deletions
|
@ -268,6 +268,15 @@ class Facts(object):
|
||||||
self.facts['distribution'] = 'FreeBSD'
|
self.facts['distribution'] = 'FreeBSD'
|
||||||
self.facts['distribution_release'] = platform.release()
|
self.facts['distribution_release'] = platform.release()
|
||||||
self.facts['distribution_version'] = platform.version()
|
self.facts['distribution_version'] = platform.version()
|
||||||
|
elif self.facts['system'] == 'OpenBSD':
|
||||||
|
self.facts['distribution'] = 'OpenBSD'
|
||||||
|
self.facts['distribution_release'] = platform.release()
|
||||||
|
rc, out, err = module.run_command("/sbin/sysctl -n kern.version")
|
||||||
|
data = re.search('OpenBSD\s[0-9]+.[0-9]+(-\S+)?\s.*', out)
|
||||||
|
if data:
|
||||||
|
self.facts['distribution_version'] = data.groups()[0][1:]
|
||||||
|
else:
|
||||||
|
self.facts['distribution_version'] = 'release'
|
||||||
else:
|
else:
|
||||||
dist = platform.dist()
|
dist = platform.dist()
|
||||||
self.facts['distribution'] = dist[0].capitalize() or 'NA'
|
self.facts['distribution'] = dist[0].capitalize() or 'NA'
|
||||||
|
|
Loading…
Reference in a new issue