mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
move machine_id back to Facts class
This commit is contained in:
@@ -241,6 +241,10 @@ class Facts(object):
|
||||
self.facts['architecture'] = data[0]
|
||||
elif self.facts['system'] == 'OpenBSD':
|
||||
self.facts['architecture'] = platform.uname()[5]
|
||||
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
|
||||
|
||||
def get_local_facts(self):
|
||||
|
||||
@@ -702,10 +706,6 @@ class Distribution(object):
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
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']
|
||||
distro = self.facts['distribution'].replace(' ', '_')
|
||||
if distro in self.OS_FAMILY:
|
||||
|
||||
Submodule lib/ansible/modules/core updated: 9eb2b557cd...4549ea5e85
Submodule lib/ansible/modules/extras updated: d9caac037c...86f08bfcda
Reference in New Issue
Block a user