openstack-ansible-pip_install/templates/pip.conf.j2

26 lines
810 B
Django/Jinja

# {{ ansible_managed }}
{% set pip_links_host_list = pip_links | map(attribute='link') | map('urlsplit', 'hostname') | list %}
{% set trusted_host_list = pip_links_host_list | union([ pip_default_index | urlsplit('hostname') ]) %}
[global]
disable-pip-version-check = {{ (pip_disable_version_check | bool) | lower }}
timeout = {{ pip_timeout }}
index-url = {{ pip_default_index }}
{% if trusted_host_list | length > 0 %}
trusted-host =
{% for host in trusted_host_list %}
{{ host }}
{% endfor %}
{% endif %}
[install]
upgrade = {{ (pip_upgrade | bool) | lower }}
upgrade-strategy = {{ pip_upgrade_strategy }}
pre = {{ (pip_enable_pre_releases | bool) | lower }}
{% if pip_links | length > 0 %}
find-links =
{% for pip_link in pip_links %}
{{ pip_link.link }}
{% endfor %}
{% endif %}