Merge "Performance: refactor pip configuration"
This commit is contained in:
commit
cfc0a1a43b
@ -1,6 +1,4 @@
|
||||
---
|
||||
- include_tasks: pip_conf.yml
|
||||
loop: "{{ pip_applicable_users }}"
|
||||
loop_control:
|
||||
loop_var: user
|
||||
- name: Ensure pip is configured
|
||||
include_tasks: pip_conf.yml
|
||||
when: (pip_local_mirror | bool) or (pip_proxy | length > 0)
|
||||
|
@ -1,12 +1,13 @@
|
||||
---
|
||||
- name: Create local .pip directory for {{ user }}
|
||||
- name: Create local .pip directory
|
||||
file:
|
||||
path: "~{{ user }}/.pip"
|
||||
path: "~{{ item }}/.pip"
|
||||
state: directory
|
||||
become: True
|
||||
become_user: "{{ user }}"
|
||||
become_user: "{{ item }}"
|
||||
loop: "{{ pip_applicable_users }}"
|
||||
|
||||
- name: Create pip.conf for {{ user }}
|
||||
- name: Create pip.conf
|
||||
copy:
|
||||
content: |
|
||||
[global]
|
||||
@ -22,16 +23,18 @@
|
||||
{% if pip_proxy | length > 0 -%}
|
||||
proxy = {{ pip_proxy }}
|
||||
{% endif -%}
|
||||
dest: "~{{ user}}/.pip/pip.conf"
|
||||
dest: "~{{ item }}/.pip/pip.conf"
|
||||
become: True
|
||||
become_user: "{{ user }}"
|
||||
become_user: "{{ item }}"
|
||||
loop: "{{ pip_applicable_users }}"
|
||||
|
||||
- name: Create .pydistutils.cfg for {{ user }}
|
||||
- name: Create .pydistutils.cfg
|
||||
copy:
|
||||
content: |
|
||||
[easy_install]
|
||||
index-url = {{ pip_index_url }}
|
||||
dest: "~{{ user}}/.pydistutils.cfg"
|
||||
dest: "~{{ item }}/.pydistutils.cfg"
|
||||
when: pip_index_url | length > 0
|
||||
become: True
|
||||
become_user: "{{ user }}"
|
||||
become_user: "{{ item }}"
|
||||
loop: "{{ pip_applicable_users }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user