Skip to content

Commit

Permalink
Merge branch 'master' of github.com:tobias-richter/ansible-python
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias-richter committed Jun 7, 2020
2 parents 0030366 + 9562711 commit 3b72a99
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# global index url for pip
# python_global_index_url: "https://pypi.python.org/simple"

# python_global_trusted_host

python_pip_packages: []
# python_global_index_url: "https://pypi.python.org/simple"

# Python os packages to install
python_os_packages:
- python3
Expand Down
9 changes: 6 additions & 3 deletions tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
package:
name: "{{ python_os_packages }}"

- name: configure pip index
- name: configure pip.
template:
src: "templates/pip.conf.j2"
src: "templates/etc/pip.conf.j2"
dest: "/etc/pip.conf"
mode: 0644
when:
Expand All @@ -18,4 +18,7 @@
- name: Update pip.
pip:
name: "{{ python_pip_package_pip }}"
executable: pip3
executable: pip3
- name: Install pip packages.
pip:
name: "{{ python_pip_packages }}"
5 changes: 5 additions & 0 deletions templates/etc/pip.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[global]
{% if python_global_trusted_host is defined %}
trusted-host = {{ python_global_trusted_host }}
{% endif %}
index-url = {{ python_global_index_url }}
2 changes: 0 additions & 2 deletions templates/pip.conf.j2

This file was deleted.

0 comments on commit 3b72a99

Please sign in to comment.