Skip to content

dgnest/ansible-role-python

Repository files navigation

Ansible Role Python

[![Build Status](https://travis-ci.org/dgnest/ansible-role-python.svg)](https://travis-ci.org/dgnest/ansible-role-python) [![Stories in Ready](https://badge.waffle.io/dgnest/ansible-role-python.svg?label=ready&title=Ready)](http://waffle.io/dgnest/ansible-role-python) [![GitHub issues](https://img.shields.io/github/issues/dgnest/ansible-role-python.svg)](https://github.com/dgnest/ansible-role-python/issues) [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)](LICENSE)

Ansible Galaxy role for pyenv.

Requirements

  • Linux
    • none
  • OSX
    • none

Install

Install it with the following command:

$ ansible-galaxy install dgnest.python

Requirements

none

Role Variables

The default role variables in defaults/main.yml are:

    ---
    python_pyenv_path: "{{ ansible_env.HOME }}/pyenv"
    python_pyenv_owner: "{{ ansible_env.USER }}"
    python_pyenv_python_versions: ["3.6.0"]
    python_pyenv_delete_virtualenvs: [{ venv_name: "latest" }]
    python_pyenv_virtualenvs: [{ venv_name: "latest", py_version: "3.6.0" }]
    python_pyenv_update_git_install: no

Dependencies

None

Example Playbook

See the examples directory.

To run this playbook with default settings, create a basic playbook like this:

    - hosts: servers
      roles:
        - dgnest.python

To install a specific version:

  - hosts: servers
    roles:
      - { role: dgnest.python }
    - hosts: servers
      roles:
         - role: dgnest.python
           python_pyenv_path: "{{ home }}/pyenv"
           python_pyenv_owner: "{{ instance_owner }}"
           python_pyenv_update_git_install: no
           python_pyenv_python_versions:
             - "3.5.1"
             - "2.7.9"
           python_pyenv_delete_virtualenvs:
             - venv_name: "delete_venv_name"
           python_pyenv_virtualenvs:
             - venv_name: "latest_v3"
               py_version: "3.5.1"

             - venv_name: "latest_v2"
               py_version: "2.7.9"

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

Made with ❤️ ️☕️ and 🍕 by dgnest.