1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add ansible_distribution_major_version to macOS (#31708)

This commit is contained in:
Sam Doran 2017-10-24 17:33:27 -04:00 committed by Adrian Likins
parent c4af03118b
commit 4dce9dc796

View file

@ -487,6 +487,8 @@ class Distribution(object):
darwin_facts['distribution'] = 'MacOSX'
rc, out, err = self.module.run_command("/usr/bin/sw_vers -productVersion")
data = out.split()[-1]
if data:
darwin_facts['distribution_major_version'] = data.split('.')[0]
darwin_facts['distribution_version'] = data
return darwin_facts