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

Alias ansible_model to ansible_product_name for Darwin. Fixes #52233 (#52242)

This commit is contained in:
Matt Martz 2019-02-18 04:22:44 -06:00 committed by John R Barker
parent 49ea68ca63
commit 9f82f3fd14
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,3 @@
minor_changes:
- facts - Alias ``ansible_model`` to ``ansible_product_name`` to more closely match other OSes
(https://github.com/ansible/ansible/issues/52233)

View file

@ -64,7 +64,7 @@ class DarwinHardware(Hardware):
mac_facts = {}
rc, out, err = self.module.run_command("sysctl hw.model")
if rc == 0:
mac_facts['model'] = out.splitlines()[-1].split()[1]
mac_facts['model'] = mac_facts['product_name'] = out.splitlines()[-1].split()[1]
mac_facts['osversion'] = self.sysctl['kern.osversion']
mac_facts['osrevision'] = self.sysctl['kern.osrevision']