perf: Translate docker isolation for ansible (#17033)

Co-authored-by: wangruidong <940853815@qq.com>
This commit is contained in:
fit2bot
2026-07-14 10:55:52 +08:00
committed by GitHub
parent 2e11ecd140
commit 6cb91413da
3 changed files with 334 additions and 294 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -69,9 +69,10 @@ def ensure_ansible_docker_image():
result = safe_run_cmd(['docker', 'image', 'inspect', ANSIBLE_EE_IMAGE])
if not result or result.returncode != 0:
raise AnsibleDockerImageNotFound(
_('Ansible Docker image "%(image)s" not found. '
'You can disable this option in System Settings - Feature Settings - Job Center - '
'Ansible Docker isolation to run locally. '
'Please run: docker pull %(image)s')
_('The Ansible Docker image "%(image)s" was not found. '
'To run jobs locally instead, disable "Docker isolation for Ansible" under '
'System Settings > Feature Settings > Job Center. '
'To continue using the Docker execution environment, run this command on the '
'Ansible worker: docker pull %(image)s')
% {'image': ANSIBLE_EE_IMAGE}
)

View File

@@ -19,10 +19,10 @@ from settings.const import (
)
ANSIBLE_DOCKER_HELP_TEXT = _(
'Run Ansible jobs in Docker execution environment (%(image)s). '
'You can disable this option in System Settings - Feature Settings - Job Center - '
'Ansible Docker isolation to run locally. '
'If the image is missing, pull it on the ansible worker: '
'Run Ansible jobs in the Docker execution environment (%(image)s). '
'To run jobs locally instead, disable "Docker isolation for Ansible" under '
'System Settings > Feature Settings > Job Center. '
'If the image is missing, run this command on the Ansible worker: '
'docker pull %(image)s'
) % {'image': ANSIBLE_EE_IMAGE}
@@ -215,7 +215,7 @@ class OpsSettingSerializer(serializers.Serializer):
)
ANSIBLE_DOCKER_ENABLED = serializers.BooleanField(
required=False,
label=_('Ansible Docker isolation'),
label=_('Docker isolation for Ansible'),
help_text=ANSIBLE_DOCKER_HELP_TEXT,
)
SECURITY_COMMAND_BLACKLIST = serializers.ListField(