Always get host from event data

* Regardless of if there is a host map or not, get the host that Ansible
  reports and assign it to the Events' host_name
This commit is contained in:
Chris Meyers
2024-01-30 14:30:51 -05:00
committed by Chris Meyers
parent f9c0b97c53
commit 527755d986

View File

@@ -95,7 +95,7 @@ class RunnerCallback:
if self.parent_workflow_job_id:
event_data['workflow_job_id'] = self.parent_workflow_job_id
event_data['job_created'] = self.job_created
if self.host_map:
host = event_data.get('event_data', {}).get('host', '').strip()
if host:
event_data['host_name'] = host