mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
Merge pull request #6640 from ryanpetrello/remove_use_venv
remove ANSIBLE_USE_VENV and TOWER_USE_VENV
This commit is contained in:
commit
bd3bfbe1d1
@ -80,9 +80,7 @@ class AnsibleInventoryLoader(object):
|
||||
self.is_vendored_source = True
|
||||
|
||||
def build_env(self):
|
||||
# Use ansible venv if it's available and setup to use
|
||||
env = dict(os.environ.items())
|
||||
if settings.ANSIBLE_USE_VENV:
|
||||
env['VIRTUAL_ENV'] = settings.ANSIBLE_VENV_PATH
|
||||
env['PATH'] = os.path.join(settings.ANSIBLE_VENV_PATH, "bin") + ":" + env['PATH']
|
||||
venv_libdir = os.path.join(settings.ANSIBLE_VENV_PATH, "lib")
|
||||
|
@ -507,7 +507,6 @@ class BaseTask(Task):
|
||||
}
|
||||
|
||||
def add_ansible_venv(self, env, add_tower_lib=True):
|
||||
if settings.ANSIBLE_USE_VENV:
|
||||
env['VIRTUAL_ENV'] = settings.ANSIBLE_VENV_PATH
|
||||
env['PATH'] = os.path.join(settings.ANSIBLE_VENV_PATH, "bin") + ":" + env['PATH']
|
||||
venv_libdir = os.path.join(settings.ANSIBLE_VENV_PATH, "lib")
|
||||
@ -522,7 +521,6 @@ class BaseTask(Task):
|
||||
return env
|
||||
|
||||
def add_tower_venv(self, env):
|
||||
if settings.TOWER_USE_VENV:
|
||||
env['VIRTUAL_ENV'] = settings.TOWER_VENV_PATH
|
||||
env['PATH'] = os.path.join(settings.TOWER_VENV_PATH, "bin") + ":" + env['PATH']
|
||||
return env
|
||||
|
@ -644,10 +644,7 @@ def wrap_args_with_proot(args, cwd, **kwargs):
|
||||
show_paths = [cwd, kwargs['private_data_dir']]
|
||||
else:
|
||||
show_paths = [cwd]
|
||||
if settings.ANSIBLE_USE_VENV:
|
||||
show_paths.append(settings.ANSIBLE_VENV_PATH)
|
||||
if settings.TOWER_USE_VENV:
|
||||
show_paths.append(settings.TOWER_VENV_PATH)
|
||||
show_paths.extend([settings.ANSIBLE_VENV_PATH, settings.TOWER_VENV_PATH])
|
||||
show_paths.extend(getattr(settings, 'AWX_PROOT_SHOW_PATHS', None) or [])
|
||||
for path in sorted(set(show_paths)):
|
||||
if not os.path.exists(path):
|
||||
|
@ -106,9 +106,7 @@ for setting in dir(this_module):
|
||||
include(optional('/etc/tower/settings.py'), scope=locals())
|
||||
include(optional('/etc/tower/conf.d/*.py'), scope=locals())
|
||||
|
||||
ANSIBLE_USE_VENV = True
|
||||
ANSIBLE_VENV_PATH = "/venv/ansible"
|
||||
TOWER_USE_VENV = True
|
||||
TOWER_VENV_PATH = "/venv/tower"
|
||||
|
||||
# If any local_*.py files are present in awx/settings/, use them to override
|
||||
|
@ -43,11 +43,9 @@ JOBOUTPUT_ROOT = '/var/lib/awx/job_status/'
|
||||
SCHEDULE_METADATA_LOCATION = '/var/lib/awx/.tower_cycle'
|
||||
|
||||
# Ansible base virtualenv paths and enablement
|
||||
ANSIBLE_USE_VENV = True
|
||||
ANSIBLE_VENV_PATH = "/var/lib/awx/venv/ansible"
|
||||
|
||||
# Tower base virtualenv paths and enablement
|
||||
TOWER_USE_VENV = True
|
||||
TOWER_VENV_PATH = "/var/lib/awx/venv/tower"
|
||||
|
||||
AWX_ISOLATED_USERNAME = 'awx'
|
||||
|
Loading…
Reference in New Issue
Block a user