Collections volume permission fix, and container group fix

Use same image for both types of container isolation

Inventory move fix related to container groups
This commit is contained in:
Alan Rominger 2020-09-29 23:17:42 -04:00 committed by Shane McDonald
parent 6e6cd51b4d
commit 7c6975baec
3 changed files with 16 additions and 8 deletions

View File

@ -1467,7 +1467,6 @@ class BaseTask(object):
'job_timeout': self.get_instance_timeout(self.instance),
'suppress_ansible_output': True,
#**process_isolation_params,
**execution_environment_params,
**resource_profiling_params,
},
}
@ -1476,6 +1475,10 @@ class BaseTask(object):
# We don't want HOME passed through to container groups.
# TODO: remove this conditional after everything is containerized
params['envvars'].pop('HOME', None)
else:
# TODO: container group jobs will not work with container isolation settings
# but both will run with same settings when worker_in and worker_out are added
params['settings'].update(execution_environment_params)
if isinstance(self.instance, AdHocCommand):
params['module'] = self.build_module_name(self.instance)
@ -1503,10 +1506,12 @@ class BaseTask(object):
module_args = ansible_runner.utils.args2cmdline(
params.get('module_args'),
)
shutil.move(
params.pop('inventory'),
os.path.join(private_data_dir, 'inventory')
)
# TODO on merge: delete if https://github.com/ansible/awx/pull/8185 is merged
if not os.path.exists(os.path.join(private_data_dir, 'inventory')):
shutil.move(
params.pop('inventory'),
os.path.join(private_data_dir, 'inventory')
)
ansible_runner.utils.dump_artifacts(params)
isolated_manager_instance = isolated_manager.IsolatedManager(

View File

@ -204,6 +204,9 @@
ANSIBLE_FORCE_COLOR: false
ANSIBLE_COLLECTIONS_PATHS: "{{projects_root}}/.__awx_cache/{{local_path}}/stage/requirements_collections"
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
# Put the local tmp directory in same volume as collection destination
# otherwise, files cannot be moved accross volumes and will cause error
ANSIBLE_LOCAL_TEMP: "{{projects_root}}/.__awx_cache/{{local_path}}/stage/tmp"
when:
- "ansible_version.full is version_compare('2.9', '>=')"

View File

@ -59,13 +59,13 @@ DATABASES = {
}
}
AWX_EXECUTION_ENVIRONMENT_DEFAULT_IMAGE = 'quay.io/ansible/ansible-runner:devel'
AWX_CONTAINER_GROUP_K8S_API_TIMEOUT = 10
AWX_CONTAINER_GROUP_POD_LAUNCH_RETRIES = 100
AWX_CONTAINER_GROUP_POD_LAUNCH_RETRY_DELAY = 5
AWX_CONTAINER_GROUP_DEFAULT_NAMESPACE = 'default'
AWX_CONTAINER_GROUP_DEFAULT_IMAGE = 'ansible/ansible-runner'
AWX_EXECUTION_ENVIRONMENT_DEFAULT_IMAGE = 'quay.io/ansible/ansible-runner:devel'
AWX_CONTAINER_GROUP_DEFAULT_IMAGE = AWX_EXECUTION_ENVIRONMENT_DEFAULT_IMAGE
# Internationalization
# https://docs.djangoproject.com/en/dev/topics/i18n/