Skip to content

Commit

Permalink
Add ansible_distribution_major_version to macOS (#31708)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4dce9dc)
  • Loading branch information
samdoran authored and abadger committed Oct 26, 2017
1 parent 21a5f1a commit 872b409
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ansible/module_utils/facts/system/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ def get_distribution_Darwin(self):
darwin_facts['distribution'] = 'MacOSX'
rc, out, err = self.module.run_command("/usr/bin/sw_vers -productVersion")
data = out.split()[-1]
darwin_facts['distribution_version'] = data
if data:
darwin_facts['distribution_major_version'] = data.split('.')[0]
darwin_facts['distribution_version'] = data
return darwin_facts

def get_distribution_FreeBSD(self):
Expand Down

0 comments on commit 872b409

Please sign in to comment.