robertdebock.python_pip

Ansible Role: Python Pip

This role allows you to install Python's pip on your system.

GitHub GitLab Downloads Version
GitHub Badge GitLab Badge Downloads Badge Version Badge

Example Playbook

Here's an example taken from molecule/default/converge.yml. It is tested whenever you push or create a pull request.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.python_pip

Before you can use this role, the machine needs preparation. In CI, this is handled with molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.epel
    - role: robertdebock.buildtools

You can find a full explanation and example on how to use these roles.

Role Variables

Default values for the variables are defined in defaults/main.yml:

---
# Default settings for python_pip

# By default, no modules should be installed. Note: This doesn’t work on Debian Bookworm and Ubuntu noble.
# See https://peps.python.org/pep-0668/
python_pip_modules: []

# You can connect to a (pypi) proxy by setting this variable.
# python_pip_proxy: "https://user:password@proxy:8443/artifactory/pypi/pypi-virtual/simple"

# Remember to trust foreign pip repositories if you decide to use them.
# python_pip_trusted_host: my-pip-repository.example.com

# This role can also update pip using pip.
python_pip_update: true

# You can specify a different pip executable if needed.
# python_pip_executable: pip3

Requirements

You will need pip packages listed in requirements.txt.

State of Used Roles

Here are the roles that are used to prepare your system. You can choose to prepare your system differently.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.buildtools Build Status GitHub Build Status GitLab
robertdebock.epel Build Status GitHub Build Status GitLab

Context

This role is part of a larger set of compatible roles. Check the documentation of these roles for more details.

Here’s a diagram showing related roles: dependencies

Compatibility

This role has been tested with these container images:

Container Tags
Alpine all
Debian all
EL 9
Fedora all
Ubuntu all

The minimum required Ansible version is 2.12, and tests have been run on:

  • The previous version
  • The current version
  • The development version

If you encounter any issues, please report them on GitHub.

License

Apache-2.0.

Author Information

The author is robertdebock.

Feel free to consider sponsoring him.

Informazioni sul progetto

Install pythons pip on your system.

Installa
ansible-galaxy install robertdebock.python_pip
Licenza
apache-2.0
Download
711.8k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.