Showing with 96 additions and 21 deletions.
  1. +7 −3 .fixtures.yml
  2. +46 −8 .travis.yml
  3. +5 −1 Gemfile
  4. +31 −0 README.md
  5. +3 −4 manifests/init.pp
  6. +0 −1 manifests/pyvenv.pp
  7. +1 −1 manifests/virtualenv.pp
  8. +3 −3 metadata.json
10 changes: 7 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
fixtures:
repositories:
"stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git"
"epel": "git://github.com/stahnma/puppet-module-epel.git"
'stdlib':
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
ref: '4.6.0'
'epel':
repo: 'git://github.com/stahnma/puppet-module-epel.git'
ref: '1.0.2'
symlinks:
"python": "#{source_dir}"
python: "#{source_dir}"
54 changes: 46 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
---
language: ruby

bundler_args: --without system_tests
script: "bundle exec metadata-json-lint metadata.json && bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"

rvm:
- 1.8.7
- 1.9.3
- 2.0.0
- 2.1.0

env:
matrix:
- PUPPET_GEM_VERSION="~> 3.1.0"
- PUPPET_GEM_VERSION="~> 3.2.0"
- PUPPET_GEM_VERSION="~> 3.3.0"
- PUPPET_GEM_VERSION="~> 3.4.0"
- PUPPET_GEM_VERSION="~> 3.5.0"
- PUPPET_GEM_VERSION="~> 3.6.0"
- PUPPET_GEM_VERSION="~> 3.7.0"
- PUPPET_GEM_VERSION="~> 3.8.0"
- PUPPET_GEM_VERSION="~> 3" FUTURE_PARSER="yes"
- PUPPET_GEM_VERSION="~> 4.0.0"
- PUPPET_GEM_VERSION="~> 4.1.0"
- PUPPET_GEM_VERSION="~> 4.2.0"
- PUPPET_GEM_VERSION="~> 4"

sudo: false

script: 'bundle exec metadata-json-lint metadata.json && bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'

matrix:
fast_finish: true
exclude:
- rvm: 2.0.0
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_VERSION="~> 3.1.0"
- rvm: 1.9.3
env: PUPPET_VERSION="~> 2.7.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.1.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.2.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.3.0"
- rvm: 2.1.0
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.0.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.1.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4.2.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 4"

sudo: false
notifications:
email: false
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ group :development, :test do
gem 'puppet-lint', :require => false
gem 'pry', :require => false
gem 'simplecov', :require => false
gem 'rspec', '~> 2.99'
end

# rspec must be v2 for ruby 1.8.7
if RUBY_VERSION >= '1.8.7' and RUBY_VERSION < '1.9'
gem 'rspec', '~> 2.0'
end

if facterversion = ENV['FACTER_GEM_VERSION']
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,37 @@

Puppet module for installing and managing python, pip, virtualenvs and Gunicorn virtual hosts.

===

# Compatibility #

* Puppet v3 (with and without the future parser)
* Puppet v4

## Ruby versions

* 1.8.7
* 1.9.3
* 2.0.0
* 2.1.0

## OS Distributions ##

This module has been tested to work on the following systems.

* Debian 6
* Debian 7
* Debian 8
* EL 5
* EL 6
* EL 7
* Suse 11
* Ubuntu 10.04
* Ubuntu 12.04
* Ubuntu 14.04

===

## Installation

```shell
Expand Down
7 changes: 3 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
$use_epel = $python::params::use_epel,
) inherits python::params{

# validate inputs
if $provider != undef {
validate_re($provider, ['^(pip|scl|rhscl)$'], 'Only "pip", "rhscl", and "scl" are valid providers besides the system default.')
if $provider != undef and $provider != '' {
validate_re($provider, ['^(pip|scl|rhscl)$'],
"Only 'pip', 'rhscl' and 'scl' are valid providers besides the system default. Detected provider is <${provider}>.")
}

if $provider == 'pip' {
Expand Down Expand Up @@ -107,7 +107,6 @@
anchor { 'python::begin': } ->
class { 'python::install': } ->
class { 'python::config': } ->
Exec<| tag == 'python-virtualenv' |> ->
anchor { 'python::end': }

# Allow hiera configuration of python resources
Expand Down
1 change: 0 additions & 1 deletion manifests/pyvenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
environment => $environment,
unless => "grep '^[\\t ]*VIRTUAL_ENV=[\\\\'\\\"]*${venv_dir}[\\\"\\\\'][\\t ]*$' ${venv_dir}/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv
require => File[$venv_dir],
tag => 'python-virtualenv',
}
} elsif $ensure == 'absent' {
file { $venv_dir:
Expand Down
2 changes: 1 addition & 1 deletion manifests/virtualenv.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
$extra_pip_args = '',
$virtualenv = undef
) {
include ::python

if $ensure == 'present' {
$python = $version ? {
Expand Down Expand Up @@ -164,7 +165,6 @@
environment => $environment,
unless => "grep '^[\\t ]*VIRTUAL_ENV=[\\\\'\\\"]*${venv_dir}[\\\"\\\\'][\\t ]*$' ${venv_dir}/bin/activate", #Unless activate exists and VIRTUAL_ENV is correct we re-create the virtualenv
require => File[$venv_dir],
tag => 'python-virtualenv',
}

if $requirements {
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stankevich-python",
"version": "1.9.6",
"version": "1.9.7",
"author": "stankevich",
"summary": "Python Module",
"license": "Apache-2.0",
Expand Down Expand Up @@ -49,11 +49,11 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">=3.0.0 < 4.0.0"
"version_requirement": ">=3.0.0 < 5.0.0"
}
],
"dependencies": [
{"name":"puppetlabs/stdlib","version_requirement":">= 4.0.0 < 6.0.0"},
{"name":"puppetlabs/stdlib","version_requirement":">= 4.6.0 < 6.0.0"},
{"name":"stahnma/epel","version_requirement":">= 1.0.1 < 2.0.0"}
]
}