Ansible needs Python 2 (version 2.6 or later) or Python 3 (version 3.5 or later) in order to work. But Python is not preinstalled on some Linux Distributions or Docker images (like on Ubuntu images). To prevent manual installation of Python on such systems, this Ansible role uses the raw module (which does not require Python) to install the Python2 or the Python3 package. Ansible can then be used normally on these systems.
You should execute this role as pre_tasks statement with gather_facts set to false like in the example below.
The supported Linux distributions for this role are:
- Alpine Linux 3.9,
- Alpine Linux 3.10,
- Alpine Linux 3.11,
- Alpine Linux 3.12,
- Alpine Linux 3.13,
- Debian 8 (Jessie),
- Debian 9 (Stretch),
- Debian 10 (Buster),
- Enterprise Linux 7,
- Enterprise Linux 8,
- Fedora 32,
- Fedora 33,
- Fedora 34,
- Ubuntu 16.04 LTS (Xenial Xerus),
- Ubuntu 18.04 LTS (Bionic Beaver) and
- Ubuntu 20.04 LTS (Focal Fossa).
The role was tested with Molecule and Docker on Travis-CI and with this Multi-VM Vagrant environment.
None.
None.
None.
---
- hosts: all
become: true
# switch gather facts off, becauѕe gather facts needs python
gather_facts: false
pre_tasks:
- name: "Install python if needed"
include_role:
name: "coglinev3.ansible_python"
- name: Gather facts
setup: # switch gather facts on
tasks:
- name: Your other tasks comes hereRelease: 1.7.0
BSD
This Ansible Role was created in 2020, by Cogline.v3.