mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 09:48:51 -03:30
Add custom venv support for proxies
This commit is contained in:
@@ -154,9 +154,22 @@ spec:
|
|||||||
serviceAccountName: awx
|
serviceAccountName: awx
|
||||||
terminationGracePeriodSeconds: 10
|
terminationGracePeriodSeconds: 10
|
||||||
{% if custom_venvs is defined %}
|
{% if custom_venvs is defined %}
|
||||||
|
{% set trusted_hosts = "" %}
|
||||||
initContainers:
|
initContainers:
|
||||||
- image: 'centos:7'
|
- image: 'centos:7'
|
||||||
name: init-custom-venvs
|
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 %}
|
||||||
|
{% endif %}
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- '-c'
|
- '-c'
|
||||||
@@ -169,10 +182,10 @@ spec:
|
|||||||
virtualenv -p {{ custom_venv.python | default(custom_venvs_python) }} \
|
virtualenv -p {{ custom_venv.python | default(custom_venvs_python) }} \
|
||||||
{{ custom_venvs_path }}/{{ custom_venv.name }} &&
|
{{ custom_venvs_path }}/{{ custom_venv.name }} &&
|
||||||
source {{ custom_venvs_path }}/{{ custom_venv.name }}/bin/activate &&
|
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 }}" &&
|
"ansible=={{ custom_venv.python_ansible_version }}" &&
|
||||||
{% if custom_venv.python_modules is defined %}
|
{% 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 %} &&
|
{% for module in custom_venv.python_modules %}{{ module }} {% endfor %} &&
|
||||||
{% endif %}
|
{% endif %}
|
||||||
deactivate &&
|
deactivate &&
|
||||||
|
|||||||
Reference in New Issue
Block a user