Showing with 28 additions and 15 deletions.
  1. +1 −1 Modulefile
  2. +10 −9 manifests/init.pp
  3. +0 −5 manifests/install.pp
  4. +17 −0 manifests/params.pp
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'stankevich-python'
version '1.7.11'
version '1.7.12'
source 'git://github.com/stankevich/puppet-python.git'
author 'stankevich'
license 'Apache License, Version 2.0'
Expand Down
19 changes: 10 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@
# Sergey Stankevich
#
class python (
$version = 'system',
$pip = true,
$dev = false,
$virtualenv = false,
$gunicorn = false,
$manage_gunicorn = true,
$provider = undef
) {
$version = $python::params::version,
$pip = $python::params::pip,
$dev = $python::params::dev,
$virtualenv = $python::params::virtualenv,
$gunicorn = $python::params::gunicorn,
$manage_gunicorn = $python::params::manage_gunicorn,
$provider = $python::params::provider,
$valid_versions = $python::params::valid_versions,
) inherits python::params{

# validate inputs
if $provider != undef {
Expand All @@ -70,7 +71,7 @@
validate_re($version, ['^(2\.[4-7]\.\d|3\.\d\.\d)$','^system$'])
# this will only be checked if not pip, every other string would be rejected by provider check
} else {
validate_re($version, concat(['system', 'pypy'], $::python::install::valid_versions))
validate_re($version, concat(['system', 'pypy'], $valid_versions))
}

validate_bool($pip)
Expand Down
5 changes: 0 additions & 5 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@

class python::install {

$valid_version = $::osfamily ? {
'RedHat' => ['3'],
'Debian' => ['3', '3.3']
}

$python = $::python::version ? {
'system' => 'python',
'pypy' => 'pypy',
Expand Down
17 changes: 17 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

# Class: python::params
# The python Module default configuration settings.
#
class python::params {
$version = 'system'
$pip = true
$dev = false
$virtualenv = false
$gunicorn = false
$manage_gunicorn = true
$provider = undef
$valid_versions = $::osfamily ? {
'RedHat' => ['3'],
'Debian' => ['3', '3.3'],
}
}