Bootstrap Python

Document Control

TODO:

  • Overall structure.
  • Initial draft complete
  • Testing
  • Ready

Ansible Role Ansible Quality Score Build Status GitHub issues GitHub last commit

User Story: Bootstrap Python using ansible raw module

As a: UNIX and Linux system administrator

I want to:

  • automatically install the required python version on the system
  • Python 2 on RHEL 7 or older systems, supporting yum and selinux
  • Python 3 on RHEL 8 or Fedora, supporting dnf
  • Python 3 on Debian systems

So that: I can manage the system using Ansible.

Manually install python on your managed node

Install python using the OS package manager

Install python2 on RHEL 7, Python 3 on RHEL 8.

Install python
# On CentOS 7 or lower, Python 2 is required.
# yum and selinux bindings are only available with python 2
sudo yum install python
sudo dnf install python3
sudo apt-get update
sudo apt-get install python3

Automate python installation using Ansible raw

Using the role

Using the role in a playbook
---
- name: bootstrap python
  hosts:
    - all
  gather_facts: false

  tasks:
    - name: bootstrap is configured
      import_role:
        name: devopstoolbox.bootstrap
      tags: bootstrap
# Install the role
ansible-galaxy install devopstoolbox.bootstrap

# Run the playbook
ansible-playbook bootstrap-playbook.yml

Last update: 2020-02-09