staticdev.pyenv

Ansible Role: Pyenv

Tests

This is an Ansible Galaxy role for installing pyenv on Debian, Ubuntu, RedHat, and OSX systems.

To install it, run the following command:

$ ansible-galaxy install staticdev.pyenv

Requirements

No requirements.

Role Variables

Below are the variables you can use, along with their default values:

  • pyenv_version: "HEAD" - Check available releases at https://github.com/pyenv/pyenv/releases
  • pyenv_virtualenv_version: "HEAD" - Check available releases at https://github.com/pyenv/pyenv-virtualenv/releases
  • pyenv_update_version: "HEAD" - Usually doesn't have releases, but you can specify a commit hash.
  • pyenv_env: "user" (can be "user" or "system")
  • pyenv_path determines where pyenv will be installed based on the environment.
  • pyenvrc_path points to the location of the configuration file.
  • pyenv_owner specifies who owns the pyenv installation.
  • pyenv_owner_group is set to the owner.
  • pyenv_python_versions: [3.12.1] - Specify which Python versions to install.
  • pyenv_virtualenvs: [{ venv_name: latest, py_version: 3.12.1 }] - Define virtual environments.
  • pyenv_global: [3.12.1] - Set the global Python version.
  • Other variables configure options for building Python.

Several variables must be explicitly defined; refer to the original documentation for details about each one.

Dependencies

No dependencies.

Example Playbook

Here’s a sample playbook to use this role:

- hosts: servers
  roles:
    - role: staticdev.pyenv
      vars:
        pyenv_version: "v2.3.35"       # Pyenv version
        pyenv_virtualenv_version: "v1.2.1" # Virtualenv version
        pyenv_update_version: "172a0ed" # Update version
        pyenv_shellrc_file: "{{ ansible_env.HOME }}/.shrc" # Shell configuration
        pyenv_path: "{{ ansible_env.HOME }}/.pyenv" # Installation path
        pyenvrc_path: "{{ ansible_env.HOME }}" # Path to the .pyenvrc file
        pyenv_owner: "{{ instance_owner }}" # Owner of the installation
        pyenv_global:
          - 3.12.1
          - 3.11.7
        pyenv_enable_autocompletion: false # Disable autocompletion
        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"

License

This project is distributed under the MIT license, making Ansible Role Pyenv free and open source software.

Author Information

Created by staticdev, based on the work of Maxim Avanov from avanov.pyenv.

Informazioni sul progetto

Ansible Galaxy role for pyenv.

Installa
ansible-galaxy install staticdev.pyenv
Licenza
mit
Download
170.7k
Proprietario