Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSX 10.10 (Yosemite) fix via ansible/ansible 30e6a65 #3

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions library/system/setup
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,9 @@ class Darwin(Hardware):
return sysctl

def get_mac_facts(self):
self.facts['model'] = self.sysctl['hw.model']
rc, out, err = module.run_command("sysctl hw.model")
if rc == 0:
self.facts['model'] = out.splitlines()[-1].split()[1]
self.facts['osversion'] = self.sysctl['kern.osversion']
self.facts['osrevision'] = self.sysctl['kern.osrevision']

Expand All @@ -1370,7 +1372,10 @@ class Darwin(Hardware):

def get_memory_facts(self):
self.facts['memtotal_mb'] = long(self.sysctl['hw.memsize']) / 1024 / 1024
self.facts['memfree_mb'] = long(self.sysctl['hw.usermem']) / 1024 / 1024

rc, out, err = module.run_command("sysctl hw.usermem")
if rc == 0:
self.facts['memfree_mb'] = long(out.splitlines()[-1].split()[1]) / 1024 / 1024

class Network(Facts):
"""
Expand Down