Construct a virtualenv for refstack

This commit is contained in:
Michael Krotscheck 2015-04-20 17:51:04 -07:00
parent 16a9df5a7a
commit 7d533c0cbb
2 changed files with 23 additions and 0 deletions

View File

@ -23,6 +23,9 @@ class refstack::api () {
# Import parameters into local scope.
$python_version = $::refstack::params::python_version
$src_api_root = $::refstack::params::src_api_root
$install_api_root = $::refstack::params::install_api_root
$user = $::refstack::params::user
$group = $::refstack::params::group
class { 'python':
version => $python_version,
@ -48,4 +51,21 @@ class refstack::api () {
require => Package['git']
}
# Create the install directory and virtual environment
file { $install_api_root:
ensure => directory,
owner => $user,
group => $group,
}
python::virtualenv { $install_api_root:
ensure => present,
version => $python_version,
owner => $user,
group => $group,
require => [
File[$install_api_root],
Class['python::install'],
],
systempkgs => false,
}
}

View File

@ -31,4 +31,7 @@ class refstack::params (
if $::operatingsystem != 'Ubuntu' or $::operatingsystemrelease < 13.10 {
fail("${::operatingsystem} ${::operatingsystemrelease} is not supported.")
}
# Create our install directory with a python-versioned name (because venv).
$install_api_root = "/var/lib/refstack-py${python_version}"
}