Skip to content
Snippets Groups Projects
Commit a0ab81d7 authored by Michal Nasiadka's avatar Michal Nasiadka
Browse files

Allow setting pip_proxy

Change-Id: I2547ef2556ca96b614854515069aaca3349cd692
parent 2e842ab3
No related branches found
No related tags found
No related merge requests found
...@@ -16,3 +16,5 @@ pip_index_url: "" ...@@ -16,3 +16,5 @@ pip_index_url: ""
# disabled # disabled
pip_trusted_hosts: [] pip_trusted_hosts: []
# Optional: proxy configuration
pip_proxy: ""
--- ---
- include_tasks: pip_local_mirror.yml - include_tasks: pip_conf.yml
loop: "{{ pip_applicable_users }}" loop: "{{ pip_applicable_users }}"
loop_control: loop_control:
loop_var: user loop_var: user
when: pip_local_mirror | bool when: (pip_local_mirror | bool) or (pip_proxy | length > 0)
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
{{ host }} {{ host }}
{% endfor -%} {% endfor -%}
{% endif -%} {% endif -%}
{% if pip_proxy | length > 0 -%}
proxy = {{ pip_proxy }}
{% endif -%}
dest: "~{{ user}}/.pip/pip.conf" dest: "~{{ user}}/.pip/pip.conf"
become: True become: True
become_user: "{{ user }}" become_user: "{{ user }}"
......
...@@ -94,21 +94,27 @@ For example, to set the bootstrap user for controllers to ``centos``: ...@@ -94,21 +94,27 @@ For example, to set the bootstrap user for controllers to ``centos``:
controller_bootstrap_user: centos controller_bootstrap_user: centos
PyPI Mirror PyPI Mirror and proxy
=========== =====================
*tags:* *tags:*
| ``pip`` | ``pip``
Kayobe supports configuration of a PyPI mirror, via variables in Kayobe supports configuration of a PyPI mirror and/or proxy, via variables in
``${KAYOBE_CONFIG_PATH}/pip.yml``. This functionality is enabled by setting the ``${KAYOBE_CONFIG_PATH}/pip.yml``.
``pip_local_mirror`` variable to ``true``. Mirror functionality is enabled by setting the ``pip_local_mirror`` variable to
``true`` and proxy functionality is enabled by setting ``pip_proxy`` variable
to a proxy URL.
Kayobe will generate configuration for:
Kayobe will generate configuration for * ``pip`` to use the mirror and proxy
``pip`` and ``easy_install`` to use the mirror, for the list of users defined * ``easy_install`` to use the mirror
by ``pip_applicable_users`` (default ``kayobe_ansible_user`` and ``root``), in
addition to the user used for Kolla Ansible (``kolla_ansible_user``). The for the list of users defined by ``pip_applicable_users`` (default
mirror URL is configured via ``pip_index_url``, and ``pip_trusted_hosts`` is a ``kayobe_ansible_user`` and ``root``), in addition to the user used for Kolla
list of 'trusted' hosts, for which SSL verification will be disabled. Ansible (``kolla_ansible_user``). The mirror URL is configured via
``pip_index_url``, and ``pip_trusted_hosts`` is a list of 'trusted' hosts, for
which SSL verification will be disabled.
For example, to configure use of the test PyPI mirror at For example, to configure use of the test PyPI mirror at
https://test.pypi.org/simple/: https://test.pypi.org/simple/:
...@@ -119,6 +125,14 @@ https://test.pypi.org/simple/: ...@@ -119,6 +125,14 @@ https://test.pypi.org/simple/:
pip_local_mirror: true pip_local_mirror: true
pip_index_url: https://test.pypi.org/simple/ pip_index_url: https://test.pypi.org/simple/
To configure use of the PyPI proxy:
.. code-block:: yaml
:caption: ``pip.yml``
pip_proxy: http://your_proxy_server:3128
Kayobe Remote Virtual Environment Kayobe Remote Virtual Environment
================================= =================================
*tags:* *tags:*
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
# disabled # disabled
#pip_trusted_hosts: [] #pip_trusted_hosts: []
# PyPI proxy URL (format: http(s)://[user:password@]proxy_name:port)
#pip_proxy: ""
############################################################################### ###############################################################################
# Dummy variable to allow Ansible to accept this file. # Dummy variable to allow Ansible to accept this file.
workaround_ansible_issue_8743: yes workaround_ansible_issue_8743: yes
---
features:
- |
Introduces a new option - ``pip_proxy`` - to configure Pip package
installation via a user-defined http(s) proxy. This is set on a per-user
basis, and by default this is for the same users as pip_local_mirror
feature.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment