Ansible Role python

This role installs Python 2 or Python 3 on the system, optionally with additional modules.

Tags

Tag

What it does

python

This role installs Python on the system, optionally with additional modules.

Optional Role Variables

Variable

Description

Default Value

python__modules__host_var / python__modules__group_var

List of dictionaries containing additional Python modules that should be installed via the OS package manager on Linux, or via pip on Windows. Subkeys:

  • * name: String, mandatory. Name of the packages.
  • state: Optional, string. Either present or absent. Defaults to present.

For the usage in host_vars / group_vars (can only be used in one group at a time).

[]

python__version

The Python version to install. Possible options for Linux:
* 2
* 3
Windows requires the full version (check the possible options here).

3

Example:

# optional
python__modules__host_var:
  - name: 'python3-psutil'
    state: 'absent'
  - name: 'python3-requests'
    state: 'present'
python__modules__group_var: []
python__version: 3

License

The Unlicense

Author Information

Linuxfabrik GmbH, Zurich