mirror of
https://github.com/ansible/awx.git
synced 2026-05-14 12:57:40 -02:30
Update the EE resolver logic
so that the control plane managed EE is kept separate.
This commit is contained in:
@@ -32,7 +32,7 @@ from awx.main.models.jobs import Job
|
|||||||
from awx.main.models.mixins import ResourceMixin, TaskManagerProjectUpdateMixin, CustomVirtualEnvMixin, RelatedJobsMixin
|
from awx.main.models.mixins import ResourceMixin, TaskManagerProjectUpdateMixin, CustomVirtualEnvMixin, RelatedJobsMixin
|
||||||
from awx.main.utils import update_scm_url, polymorphic
|
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.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.fields import ImplicitRoleField
|
||||||
from awx.main.models.rbac import (
|
from awx.main.models.rbac import (
|
||||||
ROLE_SINGLETON_SYSTEM_ADMINISTRATOR,
|
ROLE_SINGLETON_SYSTEM_ADMINISTRATOR,
|
||||||
@@ -185,11 +185,11 @@ class ProjectOptions(models.Model):
|
|||||||
|
|
||||||
def resolve_execution_environment(self):
|
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
|
Jobs using the project can use the default_environment, but the project updates
|
||||||
are not flexible enough to allow customizing the image they use.
|
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):
|
def get_project_path(self, check_if_exists=True):
|
||||||
local_path = os.path.basename(self.local_path)
|
local_path = os.path.basename(self.local_path)
|
||||||
|
|||||||
@@ -6,10 +6,14 @@ from django.conf import settings
|
|||||||
from awx.main.models.execution_environments import ExecutionEnvironment
|
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():
|
def get_default_execution_environment():
|
||||||
if settings.DEFAULT_EXECUTION_ENVIRONMENT is not None:
|
if settings.DEFAULT_EXECUTION_ENVIRONMENT is not None:
|
||||||
return settings.DEFAULT_EXECUTION_ENVIRONMENT
|
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():
|
def get_default_pod_spec():
|
||||||
|
|||||||
Reference in New Issue
Block a user