/Stouts.python

Ansible role which manage python (pip, virtualenv)

Primary LanguagePythonMIT LicenseMIT

Stouts.python

Build Status Galaxy

Ansible role which manage python's versions (pip, virtualenv)

Variables

---

python_enabled: yes                 # The role is enabled
python_ppa: ppa:fkrull/deadsnakes   # Python PPA
python_versions: [2.7, 3.4]         # Set versions (2.6, 2.7, 3.3, 3.4) which will be installed

python_install: []                  # Set packages to install globally
python_virtualenvs: []              # Create virtualenvs
                                    # Ex: python_virtualenvs:
                                    #     - path: /path/to/venv
                                    #     - path: /path/to/another/venv
                                    #       python: python3.4


python_bin: /usr/bin/python
python_pkg_bin: /usr/local/bin
python_yum_disablerepo: no
python_yum_enablerepo: no

Usage

Add Stouts.python to your roles and set vars in your playbook file.

Example:

- hosts: all

  roles:
    - Stouts.python

  vars:
    python_versions: [2.7, 3.3]
    python_install: [django, gunicorn]
    python_virtualenvs:
    - path: /opt/myproject/env

If you want the virtualenv directories to be owned by a specific user

- hosts: all

  roles:
    - Stouts.python

  vars:
    python_versions: [2.7, 3.3]
    python_install: [django, gunicorn]
    python_virtualenvs:
    - path: /opt/myproject/env
    python_virtualenv_user: "deployment"

License

Licensed under the MIT License. See the LICENSE file for details.

Feedback, bug-reports, requests, ...

Are welcome!