From 9881bb72b8e205f5a4ed9ca480cd4eeefaa13a42 Mon Sep 17 00:00:00 2001 From: Alan Rominger Date: Thu, 22 Jul 2021 15:35:10 -0400 Subject: [PATCH] Treat the awx_1 node as a hybrid node for now, use local work type (#10726) --- awx/main/models/ha.py | 2 +- awx/main/tasks.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/main/models/ha.py b/awx/main/models/ha.py index 5cb1ec2e09..984daed346 100644 --- a/awx/main/models/ha.py +++ b/awx/main/models/ha.py @@ -209,7 +209,7 @@ class InstanceGroup(HasPolicyEditsMixin, BaseModel, RelatedJobsMixin): @property def execution_capacity(self): # TODO: update query to exclude based on node_type field - return sum([inst.capacity for inst in self.instances.filter(version__startswith='ansible-runner-')]) + return sum([inst.capacity for inst in self.instances.all()]) @property def jobs_running(self): diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 07bc6af986..1e9e57ba45 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -3231,7 +3231,10 @@ class AWXReceptorJob: else: work_type = 'kubernetes-incluster-auth' elif isinstance(self.task.instance, (Job, AdHocCommand)): - work_type = 'ansible-runner' + if self.task.instance.execution_node == self.task.instance.controller_node: + work_type = 'local' + else: + work_type = 'ansible-runner' else: work_type = 'local'