mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 04:17:36 -02:30
Run isolated heartbeat against all hosts at once
Previously we were running the playbook on a host-by-host basis, but this changes it to pass in the list of all isolated isntances the machine is responsible for. Using the `json` Ansible stdout module, we are able to parse the output for information on each host.
This commit is contained in:
@@ -218,10 +218,9 @@ def tower_isolated_heartbeat(self):
|
||||
return
|
||||
cutoff_pk = UnifiedJob.lowest_running_id()
|
||||
# Slow pass looping over isolated IGs and their isolated instances
|
||||
for isolated_instance in isolated_instance_qs:
|
||||
logger.debug("Managing isolated instance {}.".format(isolated_instance.hostname))
|
||||
isolated_instance.capacity = isolated_manager.IsolatedManager.health_check(isolated_instance, cutoff_pk=cutoff_pk)
|
||||
isolated_instance.save(update_fields=['capacity'])
|
||||
if len(isolated_instance_qs) > 0:
|
||||
logger.debug("Managing isolated instances {}.".format(','.join([inst.hostname for inst in isolated_instance_qs])))
|
||||
isolated_manager.IsolatedManager.health_check(isolated_instance_qs, cutoff_pk=cutoff_pk)
|
||||
|
||||
|
||||
@task(bind=True, queue='tower')
|
||||
|
||||
Reference in New Issue
Block a user