salt.states.virtualenv

Setup of Python virtualenv sandboxes.

New in version 0.17.0.

salt.states.virtualenv_mod.managed(name, venv_bin=None, requirements=None, system_site_packages=False, distribute=False, use_wheel=False, clear=False, python=None, extra_search_dir=None, never_download=None, prompt=None, user=None, no_chown=False, cwd=None, index_url=None, extra_index_url=None, pre_releases=False, no_deps=False, pip_download=None, pip_download_cache=None, pip_exists_action=None, proxy=None, use_vt=False, env_vars=None)

Create a virtualenv and optionally manage it with pip

name
Path to the virtualenv
requirements
Path to a pip requirements file. If the path begins with salt:// the file will be transferred from the master file server.
cwd
Path to the working directory where "pip install" is executed.
user
The user under which to run virtualenv and pip
no_chown: False
When user is given, do not attempt to copy and chown a requirements file (needed if the requirements file refers to other files via relative paths, as the copy-and-chown procedure does not account for such files)
use_wheel : False
Prefer wheel archives (requires pip>=1.4)
no_deps: False
Pass --no-deps to pip.
pip_exists_action: None
Default action of pip when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup
proxy: None
Proxy address which is passed to "pip install"
env_vars
Set environment variables that some builds will depend on. For example, a Python C-module may have a Makefile that needs INCLUDE_PATH set to pick up a header file while compiling.

Also accepts any kwargs that the virtualenv module will.

/var/www/myvirtualenv.com:
  virtualenv.managed:
    - system_site_packages: False
    - requirements: salt://REQUIREMENTS.txt