mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
Merge pull request #5805 from fantashley/support-proxy-venv
Add proxy support in custom venv container fixes #5756 Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
commit
cacd2c3392
@ -154,9 +154,26 @@ spec:
|
||||
serviceAccountName: awx
|
||||
terminationGracePeriodSeconds: 10
|
||||
{% if custom_venvs is defined %}
|
||||
{% set trusted_hosts = "" %}
|
||||
initContainers:
|
||||
- image: 'centos:7'
|
||||
name: init-custom-venvs
|
||||
{% if http_proxy is defined or https_proxy is defined %}
|
||||
{% set trusted_hosts = "--trusted-host pypi.org --trusted-host files.pythonhosted.org --trusted-host pypi.python.org" %}
|
||||
env:
|
||||
{% if http_proxy is defined %}
|
||||
- name: http_proxy
|
||||
value: {{ http_proxy }}
|
||||
{% endif %}
|
||||
{% if https_proxy is defined %}
|
||||
- name: https_proxy
|
||||
value: {{ https_proxy }}
|
||||
{% endif %}
|
||||
{% if no_proxy is defined %}
|
||||
- name: no_proxy
|
||||
value: {{ no_proxy }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
command:
|
||||
- sh
|
||||
- '-c'
|
||||
@ -169,10 +186,10 @@ spec:
|
||||
virtualenv -p {{ custom_venv.python | default(custom_venvs_python) }} \
|
||||
{{ custom_venvs_path }}/{{ custom_venv.name }} &&
|
||||
source {{ custom_venvs_path }}/{{ custom_venv.name }}/bin/activate &&
|
||||
{{ custom_venvs_path }}/{{ custom_venv.name }}/bin/pip install -U psutil \
|
||||
{{ custom_venvs_path }}/{{ custom_venv.name }}/bin/pip install {{ trusted_hosts }} -U psutil \
|
||||
"ansible=={{ custom_venv.python_ansible_version }}" &&
|
||||
{% if custom_venv.python_modules is defined %}
|
||||
{{ custom_venvs_path }}/{{ custom_venv.name }}/bin/pip install -U \
|
||||
{{ custom_venvs_path }}/{{ custom_venv.name }}/bin/pip install {{ trusted_hosts }} -U \
|
||||
{% for module in custom_venv.python_modules %}{{ module }} {% endfor %} &&
|
||||
{% endif %}
|
||||
deactivate &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user