mirror of
https://github.com/ansible/awx.git
synced 2026-07-11 08:18:07 -02:30
associate insights machine id w/ host on fact scan
* Add inisghts fact scan module * Update fact scan playbook to call new insight fact scan module * JT run w/ store_facts=True will save scanned facts. We "skim" the machine_id fact from Insights fact scans and associate it with the host that the fact scan came from.
This commit is contained in:
@@ -120,6 +120,12 @@ class FactBrokerWorker(ConsumerMixin):
|
||||
ret = self._do_fact_scan_create_update(host_obj, module_name, facts, self.timestamp)
|
||||
|
||||
if job.store_facts is True:
|
||||
if module_name == 'insights':
|
||||
try:
|
||||
host_obj.insights_machine_id = facts['machine_id']
|
||||
host_obj.save()
|
||||
except StandardError:
|
||||
logger.warn('Failed to find insights machine id in insights fact scan.')
|
||||
self._do_gather_facts_update(host_obj, module_name, facts, self.timestamp)
|
||||
|
||||
message.ack()
|
||||
|
||||
Reference in New Issue
Block a user