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

Merge pull request #10284 from mihirvj/devel-10221

Pulls machine id in ansible facts
This commit is contained in:
Brian Coca 2015-02-19 12:56:45 -05:00
commit 414737557e

View file

@ -415,7 +415,10 @@ class Facts(object):
break break
else: else:
self.facts['distribution'] = name self.facts['distribution'] = name
machine_id = get_file_content("/var/lib/dbus/machine-id") or get_file_content("/etc/machine-id")
if machine_id:
machine_id = machine_id.split('\n')[0]
self.facts["machine_id"] = machine_id
self.facts['os_family'] = self.facts['distribution'] self.facts['os_family'] = self.facts['distribution']
if self.facts['distribution'] in OS_FAMILY: if self.facts['distribution'] in OS_FAMILY:
self.facts['os_family'] = OS_FAMILY[self.facts['distribution']] self.facts['os_family'] = OS_FAMILY[self.facts['distribution']]