add ability to use the role on CentOS 7

This commit is contained in:
Viacheslav Ostroukh 2018-11-07 13:25:31 +01:00 committed by Viacheslav Ostroukh
parent 4f1df0268e
commit a990947391
3 changed files with 7 additions and 2 deletions

View File

@ -18,6 +18,11 @@ The name of the packge to install to get `pip` on the system. You can set to `py
pip_install_packages: []
The role will try to autodetect pip executable: it will use `pip` for Python 2 and `pip3` for Python 3. You can also override this explicitly:
pip_executable: pip3.6
A list of packages to install with pip. Examples below:
pip_install_packages:

View File

@ -1,5 +1,5 @@
---
# For Python 3, use python3-pip.
pip_package: python-pip
pip_executable: "{{ 'pip3' if pip_package.startswith('python3') else 'pip' }}"
pip_install_packages: []

View File

@ -10,5 +10,5 @@
version: "{{ item.version | default(omit) }}"
virtualenv: "{{ item.virtualenv | default(omit) }}"
state: "{{ item.state | default(omit) }}"
executable: "{{ 'pip3' if pip_package == 'python3-pip' else 'pip' }}"
executable: "{{ pip_executable }}"
with_items: "{{ pip_install_packages }}"