Sweeping replace of old dev venv paths

This commit is contained in:
Shane McDonald
2020-12-26 21:29:22 -05:00
parent 1033c4d251
commit 6f9862c72e
23 changed files with 55 additions and 55 deletions

View File

@@ -271,7 +271,7 @@ uwsgi: collectstatic
@if [ "$(VENV_BASE)" ]; then \ @if [ "$(VENV_BASE)" ]; then \
. $(VENV_BASE)/awx/bin/activate; \ . $(VENV_BASE)/awx/bin/activate; \
fi; \ fi; \
uwsgi -b 32768 --socket 127.0.0.1:8050 --module=awx.wsgi:application --home=/venv/awx --chdir=/awx_devel/ --vacuum --processes=5 --harakiri=120 --master --no-orphans --py-autoreload 1 --max-requests=1000 --stats /tmp/stats.socket --lazy-apps --logformat "%(addr) %(method) %(uri) - %(proto) %(status)" --hook-accepting1="exec:supervisorctl restart tower-processes:awx-dispatcher tower-processes:awx-receiver" uwsgi -b 32768 --socket 127.0.0.1:8050 --module=awx.wsgi:application --home=/var/lib/awx/venv/awx --chdir=/awx_devel/ --vacuum --processes=5 --harakiri=120 --master --no-orphans --py-autoreload 1 --max-requests=1000 --stats /tmp/stats.socket --lazy-apps --logformat "%(addr) %(method) %(uri) - %(proto) %(status)" --hook-accepting1="exec:supervisorctl restart tower-processes:awx-dispatcher tower-processes:awx-receiver"
daphne: daphne:
@if [ "$(VENV_BASE)" ]; then \ @if [ "$(VENV_BASE)" ]; then \
@@ -341,7 +341,7 @@ check: flake8 pep8 # pyflakes pylint
awx-link: awx-link:
[ -d "/awx_devel/awx.egg-info" ] || python3 /awx_devel/setup.py egg_info_dev [ -d "/awx_devel/awx.egg-info" ] || python3 /awx_devel/setup.py egg_info_dev
cp -f /tmp/awx.egg-link /venv/awx/lib/python$(PYTHON_VERSION)/site-packages/awx.egg-link cp -f /tmp/awx.egg-link /var/lib/awx/venv/awx/lib/python$(PYTHON_VERSION)/site-packages/awx.egg-link
TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests TEST_DIRS ?= awx/main/tests/unit awx/main/tests/functional awx/conf/tests awx/sso/tests

View File

@@ -133,7 +133,7 @@ class AnsibleInventoryLoader(object):
# NOTE: why do we add "python" to the start of these args? # NOTE: why do we add "python" to the start of these args?
# the script that runs ansible-inventory specifies a python interpreter # the script that runs ansible-inventory specifies a python interpreter
# that makes no sense in light of the fact that we put all the dependencies # that makes no sense in light of the fact that we put all the dependencies
# inside of /venv/ansible, so we override the specified interpreter # inside of /var/lib/awx/venv/ansible, so we override the specified interpreter
# https://github.com/ansible/ansible/issues/50714 # https://github.com/ansible/ansible/issues/50714
bargs = ['python', ansible_inventory_path, '-i', self.source] bargs = ['python', ansible_inventory_path, '-i', self.source]
bargs.extend(['--playbook-dir', functioning_dir(self.source)]) bargs.extend(['--playbook-dir', functioning_dir(self.source)])

View File

@@ -16,7 +16,7 @@ def test_awx_virtualenv_from_settings(inventory, project, machine_credential):
) )
jt.credentials.add(machine_credential) jt.credentials.add(machine_credential)
job = jt.create_unified_job() job = jt.create_unified_job()
assert job.ansible_virtualenv_path == '/venv/ansible' assert job.ansible_virtualenv_path == '/var/lib/awx/venv/ansible'
@pytest.mark.django_db @pytest.mark.django_db
@@ -43,28 +43,28 @@ def test_awx_custom_virtualenv(inventory, project, machine_credential, organizat
jt.credentials.add(machine_credential) jt.credentials.add(machine_credential)
job = jt.create_unified_job() job = jt.create_unified_job()
job.organization.custom_virtualenv = '/venv/fancy-org' job.organization.custom_virtualenv = '/var/lib/awx/venv/fancy-org'
job.organization.save() job.organization.save()
assert job.ansible_virtualenv_path == '/venv/fancy-org' assert job.ansible_virtualenv_path == '/var/lib/awx/venv/fancy-org'
job.project.custom_virtualenv = '/venv/fancy-proj' job.project.custom_virtualenv = '/var/lib/awx/venv/fancy-proj'
job.project.save() job.project.save()
assert job.ansible_virtualenv_path == '/venv/fancy-proj' assert job.ansible_virtualenv_path == '/var/lib/awx/venv/fancy-proj'
job.job_template.custom_virtualenv = '/venv/fancy-jt' job.job_template.custom_virtualenv = '/var/lib/awx/venv/fancy-jt'
job.job_template.save() job.job_template.save()
assert job.ansible_virtualenv_path == '/venv/fancy-jt' assert job.ansible_virtualenv_path == '/var/lib/awx/venv/fancy-jt'
@pytest.mark.django_db @pytest.mark.django_db
def test_awx_custom_virtualenv_without_jt(project): def test_awx_custom_virtualenv_without_jt(project):
project.custom_virtualenv = '/venv/fancy-proj' project.custom_virtualenv = '/var/lib/awx/venv/fancy-proj'
project.save() project.save()
job = Job(project=project) job = Job(project=project)
job.save() job.save()
job = Job.objects.get(pk=job.id) job = Job.objects.get(pk=job.id)
assert job.ansible_virtualenv_path == '/venv/fancy-proj' assert job.ansible_virtualenv_path == '/var/lib/awx/venv/fancy-proj'
@pytest.mark.django_db @pytest.mark.django_db

View File

@@ -180,7 +180,7 @@ def test_openstack_client_config_generation(mocker, source, expected, private_da
'source_vars_dict': {}, 'source_vars_dict': {},
'get_cloud_credential': mocker.Mock(return_value=credential), 'get_cloud_credential': mocker.Mock(return_value=credential),
'get_extra_credentials': lambda x: [], 'get_extra_credentials': lambda x: [],
'ansible_virtualenv_path': '/venv/foo' 'ansible_virtualenv_path': '/var/lib/awx/venv/foo'
}) })
cloud_config = update.build_private_data(inventory_update, private_data_dir) cloud_config = update.build_private_data(inventory_update, private_data_dir)
cloud_credential = yaml.safe_load( cloud_credential = yaml.safe_load(
@@ -224,7 +224,7 @@ def test_openstack_client_config_generation_with_project_domain_name(mocker, sou
'source_vars_dict': {}, 'source_vars_dict': {},
'get_cloud_credential': mocker.Mock(return_value=credential), 'get_cloud_credential': mocker.Mock(return_value=credential),
'get_extra_credentials': lambda x: [], 'get_extra_credentials': lambda x: [],
'ansible_virtualenv_path': '/venv/foo' 'ansible_virtualenv_path': '/var/lib/awx/venv/foo'
}) })
cloud_config = update.build_private_data(inventory_update, private_data_dir) cloud_config = update.build_private_data(inventory_update, private_data_dir)
cloud_credential = yaml.safe_load( cloud_credential = yaml.safe_load(
@@ -267,7 +267,7 @@ def test_openstack_client_config_generation_with_private_source_vars(mocker, sou
'source_vars_dict': {'private': source}, 'source_vars_dict': {'private': source},
'get_cloud_credential': mocker.Mock(return_value=credential), 'get_cloud_credential': mocker.Mock(return_value=credential),
'get_extra_credentials': lambda x: [], 'get_extra_credentials': lambda x: [],
'ansible_virtualenv_path': '/venv/foo' 'ansible_virtualenv_path': '/var/lib/awx/venv/foo'
}) })
cloud_config = update.build_private_data(inventory_update, private_data_dir) cloud_config = update.build_private_data(inventory_update, private_data_dir)
cloud_credential = yaml.load( cloud_credential = yaml.load(
@@ -625,13 +625,13 @@ class TestGenericRun():
def test_invalid_custom_virtualenv(self, patch_Job, private_data_dir): def test_invalid_custom_virtualenv(self, patch_Job, private_data_dir):
job = Job(project=Project(), inventory=Inventory()) job = Job(project=Project(), inventory=Inventory())
job.project.custom_virtualenv = '/venv/missing' job.project.custom_virtualenv = '/var/lib/awx/venv/missing'
task = tasks.RunJob() task = tasks.RunJob()
with pytest.raises(tasks.InvalidVirtualenvError) as e: with pytest.raises(tasks.InvalidVirtualenvError) as e:
task.build_env(job, private_data_dir) task.build_env(job, private_data_dir)
assert 'Invalid virtual environment selected: /venv/missing' == str(e.value) assert 'Invalid virtual environment selected: /var/lib/awx/venv/missing' == str(e.value)
class TestAdhocRun(TestJobExecution): class TestAdhocRun(TestJobExecution):

View File

@@ -150,7 +150,7 @@ include(optional('/etc/tower/conf.d/*.py'), scope=locals())
# Installed differently in Dockerfile compared to production versions # Installed differently in Dockerfile compared to production versions
AWX_ANSIBLE_COLLECTIONS_PATHS = '/var/lib/awx/vendor/awx_ansible_collections' AWX_ANSIBLE_COLLECTIONS_PATHS = '/var/lib/awx/vendor/awx_ansible_collections'
BASE_VENV_PATH = "/venv/" BASE_VENV_PATH = "/var/lib/awx/venv/"
ANSIBLE_VENV_PATH = os.path.join(BASE_VENV_PATH, "ansible") ANSIBLE_VENV_PATH = os.path.join(BASE_VENV_PATH, "ansible")
AWX_VENV_PATH = os.path.join(BASE_VENV_PATH, "awx") AWX_VENV_PATH = os.path.join(BASE_VENV_PATH, "awx")

View File

@@ -6,12 +6,12 @@ const mockData = [
{ {
key: 'baz', key: 'baz',
label: 'Baz', label: 'Baz',
value: '/venv/baz/', value: '/var/lib/awx/venv/baz/',
}, },
{ {
key: 'default', key: 'default',
label: 'Default', label: 'Default',
value: '/venv/ansible/', value: '/var/lib/awx/venv/ansible/',
}, },
]; ];

View File

@@ -83,7 +83,7 @@
"PWD": "/tmp/awx_13_r1ffeqze/project", "PWD": "/tmp/awx_13_r1ffeqze/project",
"HOME": "/var/lib/awx", "HOME": "/var/lib/awx",
"LANG": "\"en-us\"", "LANG": "\"en-us\"",
"PATH": "/venv/ansible/bin:/venv/awx/bin:/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PATH": "/var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SHLVL": "4", "SHLVL": "4",
"JOB_ID": "13", "JOB_ID": "13",
"LC_ALL": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8",
@@ -96,9 +96,9 @@
"SDB_PORT": "7899", "SDB_PORT": "7899",
"MAKEFLAGS": "w", "MAKEFLAGS": "w",
"MAKELEVEL": "2", "MAKELEVEL": "2",
"PYTHONPATH": "/venv/ansible/lib/python3.6/site-packages:/awx_devel/awx/lib:/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks", "PYTHONPATH": "/var/lib/awx/venv/ansible/lib/python3.6/site-packages:/awx_devel/awx/lib:/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks",
"CURRENT_UID": "501", "CURRENT_UID": "501",
"VIRTUAL_ENV": "/venv/ansible", "VIRTUAL_ENV": "/var/lib/awx/venv/ansible",
"INVENTORY_ID": "1", "INVENTORY_ID": "1",
"MAX_EVENT_RES": "700000", "MAX_EVENT_RES": "700000",
"PROOT_TMP_DIR": "/tmp", "PROOT_TMP_DIR": "/tmp",
@@ -106,7 +106,7 @@
"SDB_NOTIFY_HOST": "docker.for.mac.host.internal", "SDB_NOTIFY_HOST": "docker.for.mac.host.internal",
"AWX_GROUP_QUEUES": "tower", "AWX_GROUP_QUEUES": "tower",
"PROJECT_REVISION": "9e2cd25bfb26ba82f40cf31276e1942bf38b3a30", "PROJECT_REVISION": "9e2cd25bfb26ba82f40cf31276e1942bf38b3a30",
"ANSIBLE_VENV_PATH": "/venv/ansible", "ANSIBLE_VENV_PATH": "/var/lib/awx/venv/ansible",
"ANSIBLE_ROLES_PATH": "/tmp/awx_13_r1ffeqze/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles", "ANSIBLE_ROLES_PATH": "/tmp/awx_13_r1ffeqze/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles",
"RUNNER_OMIT_EVENTS": "False", "RUNNER_OMIT_EVENTS": "False",
"SUPERVISOR_ENABLED": "1", "SUPERVISOR_ENABLED": "1",
@@ -119,7 +119,7 @@
"DJANGO_SETTINGS_MODULE": "awx.settings.development", "DJANGO_SETTINGS_MODULE": "awx.settings.development",
"ANSIBLE_STDOUT_CALLBACK": "awx_display", "ANSIBLE_STDOUT_CALLBACK": "awx_display",
"SUPERVISOR_PROCESS_NAME": "awx-dispatcher", "SUPERVISOR_PROCESS_NAME": "awx-dispatcher",
"ANSIBLE_CALLBACK_PLUGINS": "/awx_devel/awx/plugins/callback:/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks", "ANSIBLE_CALLBACK_PLUGINS": "/awx_devel/awx/plugins/callback:/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks",
"ANSIBLE_COLLECTIONS_PATHS": "/tmp/awx_13_r1ffeqze/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections", "ANSIBLE_COLLECTIONS_PATHS": "/tmp/awx_13_r1ffeqze/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections",
"ANSIBLE_HOST_KEY_CHECKING": "False", "ANSIBLE_HOST_KEY_CHECKING": "False",
"RUNNER_ONLY_FAILED_EVENTS": "False", "RUNNER_ONLY_FAILED_EVENTS": "False",

View File

@@ -58,7 +58,7 @@ describe('InventorySourceDetail', () => {
assertDetail(wrapper, 'Description', 'mock description'); assertDetail(wrapper, 'Description', 'mock description');
assertDetail(wrapper, 'Source', 'Sourced from a Project'); assertDetail(wrapper, 'Source', 'Sourced from a Project');
assertDetail(wrapper, 'Organization', 'Mock Org'); assertDetail(wrapper, 'Organization', 'Mock Org');
assertDetail(wrapper, 'Ansible environment', '/venv/custom'); assertDetail(wrapper, 'Ansible environment', '/var/lib/awx/venv/custom');
assertDetail(wrapper, 'Project', 'Mock Project'); assertDetail(wrapper, 'Project', 'Mock Project');
assertDetail(wrapper, 'Inventory file', 'foo'); assertDetail(wrapper, 'Inventory file', 'foo');
assertDetail(wrapper, 'Verbosity', '2 (Debug)'); assertDetail(wrapper, 'Verbosity', '2 (Debug)');

View File

@@ -55,7 +55,7 @@ const InventorySourceFormFields = ({ source, sourceOptions, i18n }) => {
const [venvField] = useField('custom_virtualenv'); const [venvField] = useField('custom_virtualenv');
const defaultVenv = { const defaultVenv = {
label: i18n._(t`Use Default Ansible Environment`), label: i18n._(t`Use Default Ansible Environment`),
value: '/venv/ansible/', value: '/var/lib/awx/venv/ansible/',
key: 'default', key: 'default',
}; };

View File

@@ -83,7 +83,7 @@
"PWD": "/tmp/awx_13_r1ffeqze/project", "PWD": "/tmp/awx_13_r1ffeqze/project",
"HOME": "/var/lib/awx", "HOME": "/var/lib/awx",
"LANG": "\"en-us\"", "LANG": "\"en-us\"",
"PATH": "/venv/ansible/bin:/venv/awx/bin:/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PATH": "/var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SHLVL": "4", "SHLVL": "4",
"JOB_ID": "13", "JOB_ID": "13",
"LC_ALL": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8",
@@ -96,9 +96,9 @@
"SDB_PORT": "7899", "SDB_PORT": "7899",
"MAKEFLAGS": "w", "MAKEFLAGS": "w",
"MAKELEVEL": "2", "MAKELEVEL": "2",
"PYTHONPATH": "/venv/ansible/lib/python3.6/site-packages:/awx_devel/awx/lib:/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks", "PYTHONPATH": "/var/lib/awx/venv/ansible/lib/python3.6/site-packages:/awx_devel/awx/lib:/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks",
"CURRENT_UID": "501", "CURRENT_UID": "501",
"VIRTUAL_ENV": "/venv/ansible", "VIRTUAL_ENV": "/var/lib/awx/venv/ansible",
"INVENTORY_ID": "1", "INVENTORY_ID": "1",
"MAX_EVENT_RES": "700000", "MAX_EVENT_RES": "700000",
"PROOT_TMP_DIR": "/tmp", "PROOT_TMP_DIR": "/tmp",
@@ -106,7 +106,7 @@
"SDB_NOTIFY_HOST": "docker.for.mac.host.internal", "SDB_NOTIFY_HOST": "docker.for.mac.host.internal",
"AWX_GROUP_QUEUES": "tower", "AWX_GROUP_QUEUES": "tower",
"PROJECT_REVISION": "9e2cd25bfb26ba82f40cf31276e1942bf38b3a30", "PROJECT_REVISION": "9e2cd25bfb26ba82f40cf31276e1942bf38b3a30",
"ANSIBLE_VENV_PATH": "/venv/ansible", "ANSIBLE_VENV_PATH": "/var/lib/awx/venv/ansible",
"ANSIBLE_ROLES_PATH": "/tmp/awx_13_r1ffeqze/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles", "ANSIBLE_ROLES_PATH": "/tmp/awx_13_r1ffeqze/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles",
"RUNNER_OMIT_EVENTS": "False", "RUNNER_OMIT_EVENTS": "False",
"SUPERVISOR_ENABLED": "1", "SUPERVISOR_ENABLED": "1",
@@ -119,7 +119,7 @@
"DJANGO_SETTINGS_MODULE": "awx.settings.development", "DJANGO_SETTINGS_MODULE": "awx.settings.development",
"ANSIBLE_STDOUT_CALLBACK": "awx_display", "ANSIBLE_STDOUT_CALLBACK": "awx_display",
"SUPERVISOR_PROCESS_NAME": "awx-dispatcher", "SUPERVISOR_PROCESS_NAME": "awx-dispatcher",
"ANSIBLE_CALLBACK_PLUGINS": "/awx_devel/awx/plugins/callback:/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks", "ANSIBLE_CALLBACK_PLUGINS": "/awx_devel/awx/plugins/callback:/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks",
"ANSIBLE_COLLECTIONS_PATHS": "/tmp/awx_13_r1ffeqze/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections", "ANSIBLE_COLLECTIONS_PATHS": "/tmp/awx_13_r1ffeqze/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections",
"ANSIBLE_HOST_KEY_CHECKING": "False", "ANSIBLE_HOST_KEY_CHECKING": "False",
"RUNNER_ONLY_FAILED_EVENTS": "False", "RUNNER_ONLY_FAILED_EVENTS": "False",

View File

@@ -98,7 +98,7 @@
"credential": 8, "credential": 8,
"overwrite":true, "overwrite":true,
"overwrite_vars":true, "overwrite_vars":true,
"custom_virtualenv":"/venv/custom", "custom_virtualenv":"/var/lib/awx/venv/custom",
"timeout":0, "timeout":0,
"verbosity":2, "verbosity":2,
"last_job_run":null, "last_job_run":null,

View File

@@ -114,7 +114,7 @@
"started": "2019-08-08T19:24:18.329589Z", "started": "2019-08-08T19:24:18.329589Z",
"finished": "2019-08-08T19:24:50.119995Z", "finished": "2019-08-08T19:24:50.119995Z",
"elapsed": 31.79, "elapsed": 31.79,
"job_args": "[\"bwrap\", \"--unshare-pid\", \"--dev-bind\", \"/\", \"/\", \"--proc\", \"/proc\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpvsg8ly2y\", \"/etc/ssh\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpq_grmdym\", \"/projects\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpfq8ea2z6\", \"/tmp\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpq6v4y_tt\", \"/var/lib/awx\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpupj_jhhb\", \"/var/log\", \"--ro-bind\", \"/venv/ansible\", \"/venv/ansible\", \"--ro-bind\", \"/venv/awx\", \"/venv/awx\", \"--bind\", \"/projects/_6__demo_project\", \"/projects/_6__demo_project\", \"--bind\", \"/tmp/awx_2_a4b1afiw\", \"/tmp/awx_2_a4b1afiw\", \"--chdir\", \"/projects/_6__demo_project\", \"ansible-playbook\", \"-u\", \"admin\", \"-i\", \"/tmp/awx_2_a4b1afiw/tmppb57i4_e\", \"-e\", \"@/tmp/awx_2_a4b1afiw/env/extravars\", \"chatty_tasks.yml\"]", "job_args": "[\"bwrap\", \"--unshare-pid\", \"--dev-bind\", \"/\", \"/\", \"--proc\", \"/proc\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpvsg8ly2y\", \"/etc/ssh\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpq_grmdym\", \"/projects\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpfq8ea2z6\", \"/tmp\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpq6v4y_tt\", \"/var/lib/awx\", \"--bind\", \"/tmp/ansible_runner_pi_pzufy15c/ansible_runner_pi_r_aeukpy/tmpupj_jhhb\", \"/var/log\", \"--ro-bind\", \"/var/lib/awx/venv/ansible\", \"/var/lib/awx/venv/ansible\", \"--ro-bind\", \"/var/lib/awx/venv/awx\", \"/var/lib/awx/venv/awx\", \"--bind\", \"/projects/_6__demo_project\", \"/projects/_6__demo_project\", \"--bind\", \"/tmp/awx_2_a4b1afiw\", \"/tmp/awx_2_a4b1afiw\", \"--chdir\", \"/projects/_6__demo_project\", \"ansible-playbook\", \"-u\", \"admin\", \"-i\", \"/tmp/awx_2_a4b1afiw/tmppb57i4_e\", \"-e\", \"@/tmp/awx_2_a4b1afiw/env/extravars\", \"chatty_tasks.yml\"]",
"job_cwd": "/projects/_6__demo_project", "job_cwd": "/projects/_6__demo_project",
"job_env": { "job_env": {
"HOSTNAME": "awx", "HOSTNAME": "awx",
@@ -123,9 +123,9 @@
"LC_ALL": "en_US.UTF-8", "LC_ALL": "en_US.UTF-8",
"SDB_HOST": "0.0.0.0", "SDB_HOST": "0.0.0.0",
"MAKELEVEL": "2", "MAKELEVEL": "2",
"VIRTUAL_ENV": "/venv/ansible", "VIRTUAL_ENV": "/var/lib/awx/venv/ansible",
"MFLAGS": "-w", "MFLAGS": "-w",
"PATH": "/venv/ansible/bin:/venv/awx/bin:/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PATH": "/var/lib/awx/venv/ansible/bin:/var/lib/awx/venv/awx/bin:/var/lib/awx/venv/awx/bin:/usr/local/n/versions/node/10.15.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SUPERVISOR_GROUP_NAME": "tower-processes", "SUPERVISOR_GROUP_NAME": "tower-processes",
"PWD": "/awx_devel", "PWD": "/awx_devel",
"LANG": "\"en-us\"", "LANG": "\"en-us\"",
@@ -138,7 +138,7 @@
"SUPERVISOR_SERVER_URL": "unix:///tmp/supervisor.sock", "SUPERVISOR_SERVER_URL": "unix:///tmp/supervisor.sock",
"SUPERVISOR_PROCESS_NAME": "awx-dispatcher", "SUPERVISOR_PROCESS_NAME": "awx-dispatcher",
"CURRENT_UID": "501", "CURRENT_UID": "501",
"_": "/venv/awx/bin/python3", "_": "/var/lib/awx/venv/awx/bin/python3",
"DJANGO_SETTINGS_MODULE": "awx.settings.development", "DJANGO_SETTINGS_MODULE": "awx.settings.development",
"DJANGO_LIVE_TEST_SERVER_ADDRESS": "localhost:9013-9199", "DJANGO_LIVE_TEST_SERVER_ADDRESS": "localhost:9013-9199",
"SDB_NOTIFY_HOST": "docker.for.mac.host.internal", "SDB_NOTIFY_HOST": "docker.for.mac.host.internal",
@@ -147,11 +147,11 @@
"ANSIBLE_HOST_KEY_CHECKING": "False", "ANSIBLE_HOST_KEY_CHECKING": "False",
"ANSIBLE_INVENTORY_UNPARSED_FAILED": "True", "ANSIBLE_INVENTORY_UNPARSED_FAILED": "True",
"ANSIBLE_PARAMIKO_RECORD_HOST_KEYS": "False", "ANSIBLE_PARAMIKO_RECORD_HOST_KEYS": "False",
"ANSIBLE_VENV_PATH": "/venv/ansible", "ANSIBLE_VENV_PATH": "/var/lib/awx/venv/ansible",
"PROOT_TMP_DIR": "/tmp", "PROOT_TMP_DIR": "/tmp",
"AWX_PRIVATE_DATA_DIR": "/tmp/awx_2_a4b1afiw", "AWX_PRIVATE_DATA_DIR": "/tmp/awx_2_a4b1afiw",
"ANSIBLE_COLLECTIONS_PATHS": "/tmp/collections", "ANSIBLE_COLLECTIONS_PATHS": "/tmp/collections",
"PYTHONPATH": "/venv/ansible/lib/python2.7/site-packages:/awx_devel/awx/lib:", "PYTHONPATH": "/var/lib/awx/venv/ansible/lib/python2.7/site-packages:/awx_devel/awx/lib:",
"JOB_ID": "2", "JOB_ID": "2",
"INVENTORY_ID": "1", "INVENTORY_ID": "1",
"PROJECT_REVISION": "23f070aad8e2da131d97ea98b42b553ccf0b0b82", "PROJECT_REVISION": "23f070aad8e2da131d97ea98b42b553ccf0b0b82",
@@ -184,5 +184,5 @@
"play_count": 1, "play_count": 1,
"task_count": 1 "task_count": 1
}, },
"custom_virtualenv": "/venv/ansible" "custom_virtualenv": "/var/lib/awx/venv/ansible"
} }

View File

@@ -153,7 +153,7 @@ describe('<OrganizationAdd />', () => {
.find('FormSelectOption') .find('FormSelectOption')
.first() .first()
.prop('value') .prop('value')
).toEqual('/venv/ansible/'); ).toEqual('/var/lib/awx/venv/ansible/');
}); });
test('AnsibleSelect component does not render if there are 0 virtual environments', async () => { test('AnsibleSelect component does not render if there are 0 virtual environments', async () => {

View File

@@ -31,7 +31,7 @@ function OrganizationFormFields({ i18n, instanceGroups, setInstanceGroups }) {
const defaultVenv = { const defaultVenv = {
label: i18n._(t`Use Default Ansible Environment`), label: i18n._(t`Use Default Ansible Environment`),
value: '/venv/ansible/', value: '/var/lib/awx/venv/ansible/',
key: 'default', key: 'default',
}; };
const { custom_virtualenvs } = useContext(ConfigContext); const { custom_virtualenvs } = useContext(ConfigContext);

View File

@@ -200,7 +200,7 @@ describe('<OrganizationForm />', () => {
.find('FormSelectOption') .find('FormSelectOption')
.first() .first()
.prop('value') .prop('value')
).toEqual('/venv/ansible/'); ).toEqual('/var/lib/awx/venv/ansible/');
}); });
test('onSubmit associates and disassociates instance groups', async () => { test('onSubmit associates and disassociates instance groups', async () => {

View File

@@ -24,7 +24,7 @@ describe('<ProjectAdd />', () => {
scm_update_on_launch: true, scm_update_on_launch: true,
scm_update_cache_timeout: 3, scm_update_cache_timeout: 3,
allow_override: false, allow_override: false,
custom_virtualenv: '/venv/custom-env', custom_virtualenv: '/var/lib/awx/venv/custom-env',
}; };
const projectOptionsResolve = { const projectOptionsResolve = {

View File

@@ -25,7 +25,7 @@ describe('<ProjectEdit />', () => {
scm_update_on_launch: true, scm_update_on_launch: true,
scm_update_cache_timeout: 3, scm_update_cache_timeout: 3,
allow_override: false, allow_override: false,
custom_virtualenv: '/venv/custom-env', custom_virtualenv: '/var/lib/awx/venv/custom-env',
summary_fields: { summary_fields: {
credential: { credential: {
id: 100, id: 100,

View File

@@ -284,11 +284,11 @@ function ProjectFormFields({
data={[ data={[
{ {
label: i18n._(t`Use Default Ansible Environment`), label: i18n._(t`Use Default Ansible Environment`),
value: '/venv/ansible/', value: '/var/lib/awx/venv/ansible/',
key: 'default', key: 'default',
}, },
...custom_virtualenvs ...custom_virtualenvs
.filter(datum => datum !== '/venv/ansible/') .filter(datum => datum !== '/var/lib/awx/venv/ansible/')
.map(datum => ({ .map(datum => ({
label: datum, label: datum,
value: datum, value: datum,

View File

@@ -22,7 +22,7 @@ describe('<ProjectForm />', () => {
scm_update_on_launch: true, scm_update_on_launch: true,
scm_update_cache_timeout: 3, scm_update_cache_timeout: 3,
allow_override: false, allow_override: false,
custom_virtualenv: '/venv/custom-env', custom_virtualenv: '/var/lib/awx/venv/custom-env',
summary_fields: { summary_fields: {
credential: { credential: {
id: 100, id: 100,

View File

@@ -153,7 +153,7 @@ EXAMPLES = '''
organization: "test" organization: "test"
scm_update_on_launch: True scm_update_on_launch: True
scm_update_cache_timeout: 60 scm_update_cache_timeout: 60
custom_virtualenv: "/var/lib/awx/venv/ansible-2.2" custom_virtualenv: "/var/lib/awx/var/lib/awx/venv/ansible-2.2"
state: present state: present
tower_config_file: "~/tower_cli.cfg" tower_config_file: "~/tower_cli.cfg"
''' '''

View File

@@ -133,10 +133,10 @@ def test_custom_venv_no_op(run_module, admin_user, base_inventory, mocker, proje
inventory=base_inventory, inventory=base_inventory,
source_project=project, source_project=project,
source='scm', source='scm',
custom_virtualenv='/venv/foobar/' custom_virtualenv='/var/lib/awx/venv/foobar/'
) )
# mock needed due to API behavior, not incorrect client behavior # mock needed due to API behavior, not incorrect client behavior
with mocker.patch('awx.main.models.mixins.get_custom_venv_choices', return_value=['/venv/foobar/']): with mocker.patch('awx.main.models.mixins.get_custom_venv_choices', return_value=['/var/lib/awx/venv/foobar/']):
result = run_module('tower_inventory_source', dict( result = run_module('tower_inventory_source', dict(
name='foo', name='foo',
description='this is the changed description', description='this is the changed description',
@@ -148,7 +148,7 @@ def test_custom_venv_no_op(run_module, admin_user, base_inventory, mocker, proje
), admin_user) ), admin_user)
assert result.pop('changed', None), result assert result.pop('changed', None), result
inv_src.refresh_from_db() inv_src.refresh_from_db()
assert inv_src.custom_virtualenv == '/venv/foobar/' assert inv_src.custom_virtualenv == '/var/lib/awx/venv/foobar/'
assert inv_src.description == 'this is the changed description' assert inv_src.description == 'this is the changed description'

View File

@@ -1,7 +1,7 @@
[pytest] [pytest]
DJANGO_SETTINGS_MODULE = awx.settings.development DJANGO_SETTINGS_MODULE = awx.settings.development
python_paths = /venv/tower/lib/python3.6/site-packages python_paths = /var/lib/awx/venv/tower/lib/python3.6/site-packages
site_dirs = /venv/tower/lib/python3.6/site-packages site_dirs = /var/lib/awx/venv/tower/lib/python3.6/site-packages
python_files = *.py python_files = *.py
addopts = --reuse-db --nomigrations --tb=native addopts = --reuse-db --nomigrations --tb=native
markers = markers =

View File

@@ -9,7 +9,7 @@ for scl in rh-postgresql10; do
done done
# Enable Tower virtualenv # Enable Tower virtualenv
for venv_path in /var/lib/awx/venv/awx /venv/awx; do for venv_path in /var/lib/awx/venv/awx; do
if [ -f $venv_path/bin/activate ]; then if [ -f $venv_path/bin/activate ]; then
. $venv_path/bin/activate . $venv_path/bin/activate
fi fi