PR #30 follow-up: Default to python3-pip.

This commit is contained in:
Jeff Geerling 2020-07-22 12:01:53 -05:00
parent 87d185606e
commit f748c258b6
7 changed files with 15 additions and 19 deletions

View File

@ -8,9 +8,10 @@ env:
matrix:
- MOLECULE_DISTRO: centos8
- MOLECULE_DISTRO: centos7
- MOLECULE_DISTRO: fedora29
- MOLECULE_DISTRO: fedora32
- MOLECULE_DISTRO: ubuntu2004
- MOLECULE_DISTRO: ubuntu1804
- MOLECULE_DISTRO: debian9
- MOLECULE_DISTRO: debian10
install:
# Install test dependencies.

View File

@ -12,11 +12,11 @@ On RedHat/CentOS, you may need to have EPEL installed before running this role.
Available variables are listed below, along with default values (see `defaults/main.yml`):
pip_package: python-pip
pip_package: python3-pip
The name of the packge to install to get `pip` on the system. You can set to `python3-pip`, for example, when using Python 3 on Ubuntu.
The name of the packge to install to get `pip` on the system. For older systems that don't have Python 3 available, you can set this to `python-pip`.
pip_executable: pip
pip_executable: pip3
The role will try to autodetect the pip executable based on the `pip_package` (e.g. `pip` for Python 2 and `pip3` for Python 3). You can also override this explicitly, e.g. `pip_executable: pip3.6`.

View File

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

View File

@ -22,10 +22,6 @@ galaxy_info:
- name: Ubuntu
versions:
- all
- name: CentOS
versions:
- 7
- 8
galaxy_tags:
- system
- server

View File

@ -16,5 +16,13 @@
apt: update_cache=true cache_valid_time=600
when: ansible_os_family == 'Debian'
- name: Set package name for older OSes.
set_fact:
pip_package: python-pip
when: >
(ansible_os_family == 'RedHat') and (ansible_distribution_major_version | int < 8)
or (ansible_distribution == 'Debian') and (ansible_distribution_major_version | int < 10)
or (ansible_distribution == 'Ubuntu') and (ansible_distribution_major_version | int < 18)
roles:
- role: geerlingguy.pip

View File

@ -1,11 +1,4 @@
---
- name: Gather OS specific variables.
include_vars: "{{ item }}"
with_first_found:
- "vars/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml"
- "vars/{{ ansible_distribution }}.yml"
- "defaults/main.yml"
- name: Ensure Pip is installed.
package:
name: "{{ pip_package }}"

View File

@ -1,2 +0,0 @@
---
pip_package: python3-pip