Skip to content
Snippets Groups Projects
Commit cfc0a1a4 authored by Zuul's avatar Zuul Committed by Gerrit Code Review
Browse files

Merge "Performance: refactor pip configuration"

parents e92724fe 43650cb9
No related branches found
No related tags found
No related merge requests found
--- ---
- include_tasks: pip_conf.yml - name: Ensure pip is configured
loop: "{{ pip_applicable_users }}" include_tasks: pip_conf.yml
loop_control:
loop_var: user
when: (pip_local_mirror | bool) or (pip_proxy | length > 0) when: (pip_local_mirror | bool) or (pip_proxy | length > 0)
--- ---
- name: Create local .pip directory for {{ user }} - name: Create local .pip directory
file: file:
path: "~{{ user }}/.pip" path: "~{{ item }}/.pip"
state: directory state: directory
become: True become: True
become_user: "{{ user }}" become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"
- name: Create pip.conf for {{ user }} - name: Create pip.conf
copy: copy:
content: | content: |
[global] [global]
...@@ -22,16 +23,18 @@ ...@@ -22,16 +23,18 @@
{% if pip_proxy | length > 0 -%} {% if pip_proxy | length > 0 -%}
proxy = {{ pip_proxy }} proxy = {{ pip_proxy }}
{% endif -%} {% endif -%}
dest: "~{{ user}}/.pip/pip.conf" dest: "~{{ item }}/.pip/pip.conf"
become: True become: True
become_user: "{{ user }}" become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"
- name: Create .pydistutils.cfg for {{ user }} - name: Create .pydistutils.cfg
copy: copy:
content: | content: |
[easy_install] [easy_install]
index-url = {{ pip_index_url }} index-url = {{ pip_index_url }}
dest: "~{{ user}}/.pydistutils.cfg" dest: "~{{ item }}/.pydistutils.cfg"
when: pip_index_url | length > 0 when: pip_index_url | length > 0
become: True become: True
become_user: "{{ user }}" become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"
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