mariancraciun1983.install_python
Python Installer Ansible Rolle
Ansible Rolle zur Installation von Python 2 oder 3 auf dem Remote-Host, auf dem Python noch nicht installiert ist.
Einführung
Wenn Python nicht auf dem Host installiert ist, sind die meisten Funktionen und Module von Ansible nicht verfügbar. Zum Beispiel hängen Module wie yum, apt und set_fact davon ab, dass Python bereits installiert ist. Dieses Modul nutzt das Raw-Modul, um Python zu erkennen und zu installieren.
Ansible
Diese Rolle wurde mit den Ansible-Versionen 2.7, 2.8, 2.9 und 2.10 getestet. Die unterstützten Plattformen sind:
- Debian
- buster
- stretch
- Ubuntu
- focal
- bionic
- xenial
- CentOS
- 8
- 7
Variablen
Es gibt nur eine Variable namens install_python_package
:
install_python_package: python3
Für Python 2, da die Paketnamen variieren, werden die folgenden empfohlen:
group_vars:
all:
install_python_package: python2
host_vars:
stretch:
install_python_package: python
bionic:
install_python_package: python
xenial:
install_python_package: python
Beispiel
# inventory
[servers]
focal.example.com install_python_package=python2
stretch.example.com install_python_package=python
# playbook.yml
- hosts: servers
gather_facts: no
roles:
- mariancraciun1983.install_python
# Rolle installieren
ansible-galaxy install mariancraciun1983.install_python
# Playbook ausführen
ansible-playbook -i inventory playbook.yml
Lizenz
MIT Lizenz
Über das Projekt
Install python 2 or 3 using the raw module where the remote system has no python installed
Installieren
ansible-galaxy install mariancraciun1983.install_python
Lizenz
mit
Downloads
939
Besitzer
¯\_(ツ)_/¯