ericsysmin.python3
ericsysmin.python3
Ansible role that installs and sets up the system or user to use Python 3 instead of Python.
Requirements
- Ubuntu version 16.04 or higher
- Debian version 9 or higher
- RHEL version 7 or higher
- CentOS version 7 or higher
Role Variables
Variable | Required | Default | Comments |
---|---|---|---|
python3_install_from |
Optional | package |
How to install Python 3: as a package or from source |
python3_package_name |
Optional | python3 |
The name of the Python package |
python3_executable_name |
Optional | {{ python3_package_name }} |
The name of the Python executable |
python3_default_system |
Optional | false |
Change /usr/bin/python to /usr/bin/{{ python3_executable_name }} |
python3_default_profile |
Optional | false |
Add 'alias python={{ python3_executable_name}}' in /etc/profile |
python3_default_user |
Optional | false |
Add 'alias python={{ python3_executable_name}}' in ~/.bashrc |
Install from Source Variables
Variable | Required | Default | Comments |
---|---|---|---|
python3_version |
Optional | 3.6.9 |
Version of the Python package |
python3_src_url |
Optional | Check defaults/main.yml | URL to download the Python source package |
python3_install_dir |
Optional | Check defaults/main.yml | Directory where the source files will be saved |
python3_debian_build_packages |
Optional | Check defaults/main.yml | Packages needed to build Python from source |
Example Playbook
To simply install Python 3 without changing the python
executable:
- hosts: servers
roles:
- role: ericsysmin.python3
To configure the current user to use Python 3:
- hosts: servers
roles:
- role: ericsysmin.python3
python3_default_user: true
To configure all users to use Python 3:
- hosts: servers
roles:
- role: ericsysmin.python3
python3_default_profile: true
To install Python 3 from source:
- hosts: servers
roles:
- role: ericsysmin.python3
python3_install_from: source
python3_version: 3.6.9
To configure the system to use Python 3 USE WITH CAUTION:
- hosts: servers
roles:
- role: ericsysmin.python3
python3_default_system: true
License
MIT License
Author Information
Informazioni sul progetto
Ansible module to install and configure python as python3
Installa
ansible-galaxy install ericsysmin.python3
Licenza
Unknown
Download
6.2k
Proprietario
Senior MTS