Fixes #7, Fixes #6: Allow customization of pip_package name.

This commit is contained in:
Jeff Geerling 2017-12-19 23:58:00 -06:00
parent 4190afbfb9
commit 65eddfe604
3 changed files with 11 additions and 15 deletions

View File

@ -12,19 +12,13 @@ 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`):
The name of the packge to install to get `pip` on the system.
pip_package: python-pip
pip_package_name: python-pip
For example:
pip_package_name: python3-pip
A list of packages to install with 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.
pip_install_packages: []
Examples below:
A list of packages to install with pip. Examples below:
pip_install_packages:
# Specify names and versions.
@ -32,19 +26,19 @@ Examples below:
version: "1.2.3"
- name: awscli
version: "1.11.91"
# Or specify bare packages to get the latest release.
- docker
- awscli
# Or uninstall a package.
- name: docker
state: absent
# Or update a package ot the latest version.
- name: docker
state: latest
# Or force a reinstall.
- name: docker
state: forcereinstall

View File

@ -1,3 +1,5 @@
---
pip_package_name: python-pip
# For Python 3, use python3-pip.
pip_package: python-pip
pip_install_packages: []

View File

@ -1,7 +1,7 @@
---
- name: Ensure Pip is installed.
package:
name: "{{pip_package_name}}"
name: "{{ pip_package }}"
state: present
- name: Ensure pip_install_packages are installed.