An Ansible Role that installs Pip on Linux.
On RedHat/CentOS, you may need to have EPEL installed before running this role. You can use the geerlingguy.repo-epel
role if you need a simple way to ensure it's installed.
Available variables are listed below, along with default values (see defaults/main.yml
):
pip_package: python3-pip
The name of the packge to install to get pip
on the system. You can set to python-pip
, for example, when using Python 2 on Ubuntu.
pip_version: pip3
The version of pip
to used running installtions. You can set to pip2
, for example, when using Python 2 on Ubuntu.
pip_install_packages: []
A list of packages to install with pip. Examples below:
pip_install_packages:
# Specify names and versions.
- name: docker
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
None.
- hosts: all
roles:
- geerlingguy.pip
MIT / BSD
This role was created in 2017 by Jeff Geerling, author of Ansible for DevOps.