GithubHelp home page GithubHelp logo

kota65535 / ansible-role-pyenv Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 45 KB

Ansible Galaxy role for pyenv and pyenv-virtualenv on RHEL, Ubuntu, and Mac OS.

License: MIT License

Shell 5.76% Python 94.24%

ansible-role-pyenv's Introduction

kota65535.pyenv

Build Status

Ansible role for installing pyenv and pyenv-virtualenv on RHEL and Ubuntu.

Install it with the following command:

$ ansible-galaxy install kota65535.pyenv

Dependencies

  • ansible >= 2.2.1

Role Variables

  • pyenv_users - Array of usernames for multiuser install. User must be present in the system.
  • pyenv_python_versions - Python versions to be installed
  • pyenv_virtualenvs - Dict of virtualenvs created for each users. Following keys should be set.
    • venv_name: the name of the virtualenv
    • py_version: python version used by the virtualenv
  • pyenv_root - Install path of pyenv
  • pyenv_profile_path - Install path of pyenv initialization script

You can use X as the latest version number to specify python version (ex. 3.5.X).

The default values are as follows:

pyenv_python_versions: []
pyenv_virtualenvs: []
pyenv_root: "~/.pyenv"
pyenv_repo: "https://github.com/yyuu/pyenv.git"
pyenv_virtualenv_repo: "https://github.com/yyuu/pyenv-virtualenv.git"

Example Playbooks

1. Personal setup

  • Install pyenv for me only
  • Install python 2.7.12 and the latest version of 3.5
  • Create virtualenvs with the installed pythons
  • Add lines to ~/.bashrc to initialize pyenv
 - hosts: all
   vars:
     pyenv_python_versions:
       - 2.7.12
       - 3.5.X
     pyenv_virtualenvs:
       - venv_name: the-conventional
         py_version: 2.7.12
       - venv_name: the-latest
         py_version: 3.5.X
     pyenv_profile_path: ~/.bashrc
   roles:
     - kota65535.pyenv

2. Multiple users, global profile

  • Install pyenv for users test01 and test02
  • Install python 2.7.12
  • Crerate /etc/profile.d/pyenv.sh to initialize pyenv for all users
- hosts: all
  vars:
    pyenv_python_versions:
      - 2.7.12
    pyenv_users:
      - test01
      - test02
    pyenv_profile_path: /etc/profile.d/pyenv.sh
    pyenv_profile_owner: root
  roles:
    - kota65535.pyenv

3. Multiple users, personal profiles

  • Install pyenv for users test01 and test02
  • Install python 2.7.12
  • Add lines to ~/.bashrc of each users to initialize pyenv
- hosts: all
  vars:
    pyenv_python_versions:
      - 2.7.12
    pyenv_users:
      - test01
      - test02
    pyenv_profile_path: ~/.bashrc
  roles:
    - kota65535.pyenv

License

MIT

Author Information

Tomohiko Ozawa (https://github.com/kota65535)

ansible-role-pyenv's People

Contributors

kota65535 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.