diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index d2b62eac7e..1c34871205 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -32,7 +32,7 @@ from awx.main.models.jobs import Job from awx.main.models.mixins import ResourceMixin, TaskManagerProjectUpdateMixin, CustomVirtualEnvMixin, RelatedJobsMixin from awx.main.utils import update_scm_url, polymorphic from awx.main.utils.ansible import skip_directory, could_be_inventory, could_be_playbook -from awx.main.utils.execution_environments import get_default_execution_environment +from awx.main.utils.execution_environments import get_control_plane_execution_environment from awx.main.fields import ImplicitRoleField from awx.main.models.rbac import ( ROLE_SINGLETON_SYSTEM_ADMINISTRATOR, @@ -185,11 +185,11 @@ class ProjectOptions(models.Model): def resolve_execution_environment(self): """ - Project updates, themselves, will use the default execution environment. + Project updates, themselves, will use the control plane execution environment. Jobs using the project can use the default_environment, but the project updates are not flexible enough to allow customizing the image they use. """ - return get_default_execution_environment() + return get_control_plane_execution_environment() def get_project_path(self, check_if_exists=True): local_path = os.path.basename(self.local_path) diff --git a/awx/main/utils/execution_environments.py b/awx/main/utils/execution_environments.py index 67fee9566d..8598b7024f 100644 --- a/awx/main/utils/execution_environments.py +++ b/awx/main/utils/execution_environments.py @@ -6,10 +6,14 @@ from django.conf import settings from awx.main.models.execution_environments import ExecutionEnvironment +def get_control_plane_execution_environment(): + return ExecutionEnvironment.objects.filter(organization=None, managed_by_tower=True).first() + + def get_default_execution_environment(): if settings.DEFAULT_EXECUTION_ENVIRONMENT is not None: return settings.DEFAULT_EXECUTION_ENVIRONMENT - return ExecutionEnvironment.objects.filter(organization=None, managed_by_tower=True).first() + return ExecutionEnvironment.objects.filter(organization=None, managed_by_tower=False).first() def get_default_pod_spec():