Files
kayobe/ansible/roles/pip/tasks/pip_conf.yml
Mark Goddard a477cd9022 Fix use of become_user by installing acl package
Change-Id: I69bf810632d09eddaa3983ae56e833debe9fd03b
2022-08-17 11:29:36 +01:00

41 lines
1000 B
YAML

---
- name: Create local .pip directory
file:
path: "~{{ item }}/.pip"
state: directory
become: True
become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"
- name: Create pip.conf
copy:
content: |
[global]
{% if pip_index_url | length > 0 -%}
index-url = {{ pip_index_url }}
{% endif -%}
{% if pip_trusted_hosts | length > 0 -%}
trusted-host =
{% for host in pip_trusted_hosts | unique -%}
{{ host }}
{% endfor -%}
{% endif -%}
{% if pip_proxy | length > 0 -%}
proxy = {{ pip_proxy }}
{% endif -%}
dest: "~{{ item }}/.pip/pip.conf"
become: True
become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"
- name: Create .pydistutils.cfg
copy:
content: |
[easy_install]
index-url = {{ pip_index_url }}
dest: "~{{ item }}/.pydistutils.cfg"
when: pip_index_url | length > 0
become: True
become_user: "{{ item }}"
loop: "{{ pip_applicable_users }}"