Code Monkey home page Code Monkey logo

ansible-install-python's Introduction

Python Installer Ansible Role



Ansible role for installing python 2 or 3 using raw module on the remote host that does not have python installed yet.

Introduction

If python is not installed on the host, most of Ansible's functionality and modules aren't available. For example modules like yum, apt and set_fact rely on python being already installed. This module takes advantage of the raw module to detect and install python.

Ansible

This role was tested against Ansible version 2.7 2.8 2.9 2.10 . The supported platforms are

  • Debian
    • buster
    • stretch
  • Ubuntu
    • focal
    • bionic
    • xenial
  • Centos
    • 8
    • 7

Variables

There is only one variable called install_python_package:

install_python_package: python3

For python2 however, since the package names vary, the following are suggested:

group_vars:
  all:
    install_python_package: python2
host_vars:
  stretch:
    install_python_package: python
  bionic:
    install_python_package: python
  xenial:
    install_python_package: python

Example

# 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
# install the role
ansible-galaxy install mariancraciun1983.install_python
# run the playbook
ansible-playbook -i inventory playbook.yml

License

MIT License

ansible-install-python's People

Contributors

mariancraciun1983 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

mickpah

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.