This Ansible role installs and configures pyenv
for managing Python versions on your systems.
- Ansible >= 2.9
- Python packages on target systems (might be required by
pyenv-installer.sh
)
pyenv_root
: (Optional) Path to thepyenv
installation directory. Defaults to/opt/pyenv
.pyenv_deb_packages
: (List) List of Debian/Ubuntu package names required forpyenv
(e.g.,build-essential
).pyenv_rpm_packages
: (List) List of RPM package names required forpyenv
(e.g.,gcc
).
- None
---
- hosts: all
become: true # Required for some installation steps
roles:
- role: pyenv
pyenv_root: ~/.pyenv # Optional, customize if needed. Defaults to `/opt/pyenv`
- Clone or copy this role directory into your Ansible roles directory.
- (Optional) Modify the role variables (
defaults/main.yml
andvars/main.yml
) to customize settings likepyenv_root
, package lists, etc. Since I only added packages for Debian family and Red Hat family. - Include the role in your playbook as described in the documentation for your chosen Ansible playbook format.
MIT License
rlko
- System dependencies for
pyenv
installation are on based the pyenv wiki. - Consider error handling and logging mechanisms in your playbook for a more robust deployment.