echocat/puppet-graphite — pull request #125 by everestx (2014-12-14 05:27:02+00:00)
Title: Allow use of virtualenv via stankevich/python

This new pull request allows pip package installs
at the system level or inside a virtualenv

- Setting $python_provider to 'system' is the
default and shouldn't cause any deviation in behavior
- Setting $python_provider to 'virtualenv' sets up
the /opt/graphite directory as a venv
- If using a virtualenv, some other things need to be
aware. Init scripts and wsgi get VIRTUAL_ENV and PATH setups
- Use PYTHONPATH in Pip environment to account for the
non-standard carbon and graphite-web paths. This is cleaner
than keeping track of symlinks to the system path

Details on the files that changed:

manifests/init.pp

- add $python_provider variable

manifests/params.pp

- add $virtualenv variable
- remove OS packages that can be pip installed
- this provided less EPEL dependencies

manifests/config.pp

- setup $venv_environement variable to invoke venv

manifests/config_apache.pp

- setup the $virtualenv variable to use in wsgi

templates/{RedHat/Debian}/*.pp
- setup init scripts to use $venv_environment
- this allows venv pip packages to be imported