arillso.system.python role – Python package management with pip

Note

This role is part of the arillso.system collection (version 1.0.5).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install arillso.system.

To use it in a playbook, specify: arillso.system.python.

Entry point main – Python package management with pip

Synopsis

  • Manages Python packages via pip

  • Supports virtualenv and system-wide installation

Parameters

Parameter

Comments

python_debug_mode

boolean

Enable debug output for troubleshooting

Choices:

  • false ← (default)

  • true

python_dev_packages

list / elements=string

Development packages to install

Default: []

python_install_packages

boolean

Install Python system packages

Choices:

  • false

  • true ← (default)

python_packages

list / elements=dictionary

List of Python packages to manage

Default: []

executable

string

Pip executable to use

extra_args

string

Extra arguments for pip

name

string / required

Package name

state

string

Package state

Choices:

  • "present" ← (default)

  • "latest"

  • "absent"

version

string

Package version

virtualenv

string

Virtualenv path

virtualenv_command

string

Command to create virtualenv

virtualenv_python

string

Python interpreter for virtualenv

virtualenv_site_packages

boolean

Allow virtualenv access to system site-packages

Choices:

  • false

  • true

python_pip_enabled

boolean

Enable pip package management

Choices:

  • false

  • true ← (default)

python_pip_executable

string

Default pip executable

Default: "pip3"

python_pip_extra_args

string

Extra arguments passed to pip

Default: ""

python_requirements_files

list / elements=dictionary

List of requirements files to install

Default: []

executable

string

Pip executable to use

extra_args

string

Extra arguments for pip

path

string / required

Path to requirements file

state

string

Desired state

Choices:

  • "present" ← (default)

  • "absent"

virtualenv

string

Virtualenv path

virtualenv_command

string

Command to create virtualenv

virtualenv_python

string

Python interpreter for virtualenv

virtualenv_site_packages

boolean

Allow virtualenv access to system site-packages

Choices:

  • false

  • true

python_retry_count

integer

Number of retry attempts for tasks

Default: 3

python_retry_delay

integer

Delay in seconds between retry attempts

Default: 10

python_system_packages

list / elements=string

System packages to install for Python

Default: ["python3", "python3-pip", "python3-venv"]

python_upgrade_pip

boolean

Upgrade pip before installing packages

Choices:

  • false ← (default)

  • true

python_virtualenv_command

string

Command to create virtualenvs

Default: "python3 -m venv"

python_virtualenv_enabled

boolean

Enable virtualenv management

Choices:

  • false

  • true ← (default)

python_virtualenv_python

string

Python interpreter for virtualenvs

Default: "python3"

python_virtualenv_site_packages

boolean

Allow virtualenv access to system site-packages

Choices:

  • false ← (default)

  • true

Entry point pip – Pip package management entry point

Synopsis

  • Entry point for managing Python packages

Parameters

Parameter

Comments

python_packages

list / elements=dictionary / required

List of packages to manage

executable

string

Pip executable to use

extra_args

string

Extra arguments for pip

name

string / required

Package name

state

string

Package state

Choices:

  • "present" ← (default)

  • "latest"

  • "absent"

version

string

Package version

virtualenv

string

Virtualenv path

virtualenv_command

string

Command to create virtualenv

virtualenv_python

string

Python interpreter for virtualenv

virtualenv_site_packages

boolean

Allow virtualenv access to system site-packages

Choices:

  • false

  • true

Entry point requirements – Requirements file entry point

Synopsis

  • Entry point for installing from requirements.txt

Parameters

Parameter

Comments

python_requirements_files

list / elements=dictionary / required

List of requirements files

executable

string

Pip executable to use

extra_args

string

Extra arguments for pip

path

string / required

Path to requirements file

state

string

Desired state

Choices:

  • "present" ← (default)

  • "absent"

virtualenv

string

Virtualenv path

virtualenv_command

string

Command to create virtualenv

virtualenv_python

string

Python interpreter for virtualenv

virtualenv_site_packages

boolean

Allow virtualenv access to system site-packages

Choices:

  • false

  • true