DEPRECATED: this project is not maintained anymore in favor direct installation with nix package manager and Nixpkgs.
Ansible Galaxy role for pyenv on Debian / Ubuntu / RedHat / OSX.
Install it with the following command:
$ ansible-galaxy install staticdev.pyenvNone.
Here is the list of all variables and their default values:
pyenv_version: "HEAD"- check https://github.com/pyenv/pyenv/releasespyenv_virtualenv_version: "HEAD"- check https://github.com/pyenv/pyenv-virtualenv/releasespyenv_update_version: "HEAD"- usually do not have releases but one can specify a commit hashpyenv_env: "user"(should be either"user"or"system")pyenv_path: "{% if pyenv_env == 'user' %}{{ ansible_env.HOME }}/pyenv{% else %}/usr/local/pyenv{% endif %}"pyenvrc_path: "{{ pyenv_path }}"pyenv_owner: "{{ ansible_facts.user_id }}"pyenv_owner_group: "{{ pyenv_owner }}"pyenv_python_versions: [3.12.1]pyenv_virtualenvs: [{ venv_name: latest, py_version: 3.12.1 }]pyenv_global: [3.12.1]pyenv_update_git_install: true(get latest pyenv from git)pyenv_enable_autocompletion: falsepyenv_enable_virtualenvs: truepyenv_shellrc_file: "{% if pyenv_env == 'user' %}~/.bashrc{% else %}/etc/profile.d/pyenv.sh{% endif %}"pyenv_tmpdir: (must be explicitly defined)- env variableTMPDIRused by python-build as described in Special Environment Variables.pyenv_python_build_build_path: (must be explicitly defined)- env variablePYTHON_BUILD_BUILD_PATHused by python-build as described in Special Environment Variables.pyenv_python_build_cache_path: (must be explicitly defined)- env variablePYTHON_BUILD_CACHE_PATHused by python-build as described in Special Environment Variables.pyenv_python_build_mirror_url: (must be explicitly defined)- env variablePYTHON_BUILD_MIRROR_URLused by python-build as described in Special Environment Variables.pyenv_python_build_mirror_url_skip_checksum: (must be explicitly defined)- env variablePYTHON_BUILD_MIRROR_URL_SKIP_CHECKSUMused by python-build as described in Special Environment Variables.pyenv_python_build_skip_mirror: (must be explicitly defined)- env variablePYTHON_BUILD_SKIP_MIRRORused by python-build as described in Special Environment Variables.pyenv_python_build_skip_homebrew: (must be explicitly defined)- env variablePYTHON_BUILD_SKIP_HOMEBREWused by python-build as described in Special Environment Variables.pyenv_python_build_root: (must be explicitly defined)- env variablePYTHON_BUILD_ROOTused by python-build as described in Special Environment Variables.pyenv_python_build_definitions: (must be explicitly defined)- env variablePYTHON_BUILD_DEFINITIONSused by python-build as described in Special Environment Variables.pyenv_python_configure_opts: (must be explicitly defined)- env variablePYTHON_CONFIGURE_OPTSused by python-build as described in Special Environment Variables.pyenv_python_cflags: (must be explicitly defined)- env variablePYTHON_CFLAGSused by python-build as described in Special Environment Variables.pyenv_python_make_opts: (must be explicitly defined)- env variablePYTHON_MAKE_OPTSused by python-build as described in Special Environment Variables.pyenv_python_make_install_opts: (must be explicitly defined)- env variablePYTHON_MAKE_INSTALL_OPTSused by python-build as described in Special Environment Variables.pyenv_configure_opts: (must be explicitly defined)- env variableCONFIGURE_OPTSused by python-build as described in Special Environment Variables.pyenv_cc: (must be explicitly defined)- env variableCCused by python-build as described in Special Environment Variables.pyenv_make: (must be explicitly defined)- env variableMAKEused by python-build as described in Special Environment Variables.pyenv_make_opts: (must be explicitly defined)- env variableMAKE_OPTSused by python-build as described in Special Environment Variables.pyenv_make_install_opts: (must be explicitly defined)- env variableMAKE_INSTALL_OPTSused by python-build as described in Special Environment Variables.pyenv_profile_task: (must be explicitly defined)- env variablePROFILE_TASKto customize the task used for profile guided optimization as described in building Python for maximum performance. See also here.pyenv_custom_pyenvrc_file: (must be explicitly defined)- path to a custom.pyenvrcshell file that will be sourced from{{ pyenvrc_path }}/.pyenvrc. It allows you to freely customize the environment to be used duringpyenvexecution. If defined, this file will be copied as{{ pyenvrc_path }}/.pyenvrc.custom.pyenv_install_extra_opts: ("" -no extra options added-)- check output ofpyenv install --helpfor available additional options.
None.
- hosts: servers
roles:
- role: staticdev.pyenv
vars:
# from https://github.com/pyenv/pyenv/releases
pyenv_version: "v2.3.35"
# from https://github.com/pyenv/pyenv-virtualenv/releases
pyenv_virtualenv_version: "v1.2.1"
# from https://github.com/pyenv/pyenv-update/commits/master/
pyenv_update_version: "172a0ed"
pyenv_shellrc_file: "{{ ansible_env.HOME }}/.shrc"
pyenv_path: "{{ ansible_env.HOME }}/.pyenv"
pyenvrc_path: "{{ ansible_env.HOME }}"
pyenv_owner: "{{ instance_owner }}"
pyenv_global:
- 3.12.1
- 3.11.7
pyenv_enable_autocompletion: false
pyenv_python_versions:
- 3.12.1
- 3.11.7
pyenv_virtualenvs:
- venv_name: latest_v312
py_version: 3.12.1
- venv_name: latest_v311
py_version: 3.11.7
pyenv_make_opts: "-j4"
pyenv_python_configure_opts: "--enable-optimizations --with-lto --with-ensurepip=upgrade"
pyenv_python_cflags: "-march=native -mtune=native"
pyenv_profile_task: "-m test.regrtest --pgo -j0"Distributed under the terms of the MIT license, Ansible role Pyenv is free and open source software.
staticdev. Heavily based on Maxim Avanov's avanov.pyenv