Showing with 190 additions and 620 deletions.
  1. +3 −0 .github/SECURITY.md
  2. +1 −1 .msync.yml
  3. +3 −0 .rubocop.yml
  4. +0 −3 .sync.yml
  5. +3 −10 .travis.yml
  6. +33 −55 CHANGELOG.md
  7. +3 −3 Gemfile
  8. +20 −3 lib/facter/pip_version.rb
  9. +2 −1 lib/facter/virtualenv_version.rb
  10. +0 −2 manifests/config.pp
  11. +1 −1 manifests/dotfile.pp
  12. +0 −1 manifests/gunicorn.pp
  13. +7 −9 manifests/init.pp
  14. +1 −5 manifests/install.pp
  15. +2 −2 manifests/params.pp
  16. +8 −9 manifests/pip.pp
  17. +2 −2 manifests/pip/bootstrap.pp
  18. +3 −4 manifests/pyvenv.pp
  19. +1 −2 manifests/requirements.pp
  20. +1 −1 manifests/virtualenv.pp
  21. +1 −3 metadata.json
  22. +2 −2 spec/acceptance/facts_test_spec.rb
  23. +0 −13 spec/acceptance/nodesets/archlinux-2-x64.yml
  24. +0 −10 spec/acceptance/nodesets/centos-59-x64.yml
  25. +0 −12 spec/acceptance/nodesets/centos-64-x64-pe.yml
  26. +0 −10 spec/acceptance/nodesets/centos-65-x64.yml
  27. +0 −10 spec/acceptance/nodesets/debian-70rc1-x64.yml
  28. +0 −11 spec/acceptance/nodesets/debian-73-x64.yml
  29. +0 −11 spec/acceptance/nodesets/default.yml
  30. +0 −31 spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml
  31. +0 −34 spec/acceptance/nodesets/ec2/image_templates.yaml
  32. +0 −29 spec/acceptance/nodesets/ec2/rhel-73-x64.yml
  33. +0 −29 spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml
  34. +0 −29 spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml
  35. +0 −29 spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml
  36. +0 −10 spec/acceptance/nodesets/ubuntu-server-10044-x64.yml
  37. +0 −10 spec/acceptance/nodesets/ubuntu-server-12042-x64.yml
  38. +0 −147 spec/classes/python_spec.rb
  39. +1 −1 spec/defines/pyvenv_spec.rb
  40. +0 −4 spec/spec_helper.rb
  41. +3 −0 spec/spec_helper_acceptance.rb
  42. +49 −5 spec/unit/facter/pip_version_spec.rb
  43. +18 −25 spec/unit/facter/python_release_spec.rb
  44. +17 −25 spec/unit/facter/python_version_spec.rb
  45. +5 −16 spec/unit/facter/virtualenv_version_spec.rb
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Vox Pupuli Security Policy

Our vulnerabilities reporting process is at https://voxpupuli.org/security/
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.12.0'
modulesync_config_version: '3.0.0'
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,9 @@ RSpec/RepeatedDescription:
RSpec/NestedGroups:
Enabled: False

RSpec/MultipleExpectations:
Enabled: false

# this is broken on ruby1.9
Layout/IndentHeredoc:
Enabled: False
Expand Down
3 changes: 0 additions & 3 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
docker_sets:
- set: ubuntu1604-64
- set: ubuntu1804-64
- set: debian8-64
- set: debian9-64
- set: centos7-64
spec/spec_helper.rb:
mock_with: ':mocha'
spec/spec_helper_acceptance.rb:
unmanaged: false
13 changes: 3 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
os: linux
dist: bionic
language: ruby
cache: bundler
Expand All @@ -7,7 +8,7 @@ before_install:
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
jobs:
fast_finish: true
include:
- rvm: 2.4.4
Expand Down Expand Up @@ -38,14 +39,6 @@ matrix:
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=ubuntu1804-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian8-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_setfile=debian8-64 CHECK=beaker
services: docker
- rvm: 2.5.3
bundler_args: --without development release
env: BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_setfile=debian9-64 CHECK=beaker
Expand Down Expand Up @@ -76,7 +69,7 @@ notifications:
- "chat.freenode.org#voxpupuli-notifications"
deploy:
provider: puppetforge
user: puppet
username: puppet
password:
secure: "bBDDSSz8OQwK0zxJ4EjM01bE4uoNMzTXyxp2lllXdv6PYAJCI4bCCcdRF7OKLAWaRtm6c0HJGnfMXzmwqHF/pJSUZzfTGe4uwZrrmaGvdalP4fXtLWpviAoez8La0Nx7JYqwPPprP7nySBD8M3rUuOZJetXQM6yGgj4YSs2lKMo="
on:
Expand Down
88 changes: 33 additions & 55 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v5.0.0](https://github.com/voxpupuli/puppet-python/tree/v5.0.0) (2020-09-23)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v4.1.1...v5.0.0)

**Breaking changes:**

- Drop CentOS 6 support [\#566](https://github.com/voxpupuli/puppet-python/pull/566) ([bastelfreak](https://github.com/bastelfreak))
- Drop EOL Debian 8 [\#563](https://github.com/voxpupuli/puppet-python/pull/563) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- Fix undefined method error in facts [\#555](https://github.com/voxpupuli/puppet-python/pull/555) ([wiebe](https://github.com/wiebe))

**Closed issues:**

- "warning: already initialized constant PIP\_VERSION" when upgrading to agent 6.15.0 [\#553](https://github.com/voxpupuli/puppet-python/issues/553)
- "undefined method \[\]" in pip\_version and virtualenv\_version facts [\#527](https://github.com/voxpupuli/puppet-python/issues/527)
- Deprecation Warnings - Mocha mock\_with [\#432](https://github.com/voxpupuli/puppet-python/issues/432)

**Merged pull requests:**

- delete legacy nodesets [\#562](https://github.com/voxpupuli/puppet-python/pull/562) ([bastelfreak](https://github.com/bastelfreak))
- modulesync 3.0.0 & puppet-lint updates [\#556](https://github.com/voxpupuli/puppet-python/pull/556) ([bastelfreak](https://github.com/bastelfreak))
- Convert unit tests to rspec rather than 'mocha' [\#554](https://github.com/voxpupuli/puppet-python/pull/554) ([KeithWard](https://github.com/KeithWard))

## [v4.1.1](https://github.com/voxpupuli/puppet-python/tree/v4.1.1) (2020-04-30)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v4.1.0...v4.1.1)
Expand Down Expand Up @@ -258,7 +283,7 @@ These should not affect the functionality of the module.
- Update gunicorn.pp - Add manage\_config\_dir [\#382](https://github.com/voxpupuli/puppet-python/pull/382) ([bc-bjoern](https://github.com/bc-bjoern))
- Support latest puppet versions [\#376](https://github.com/voxpupuli/puppet-python/pull/376) ([ghoneycutt](https://github.com/ghoneycutt))
- Add python release as available facts [\#355](https://github.com/voxpupuli/puppet-python/pull/355) ([jcpunk](https://github.com/jcpunk))
- Allow hiera config for dotfiles [\#344](https://github.com/voxpupuli/puppet-python/pull/344) ([chaozhang0326](https://github.com/chaozhang0326))
- Allow hiera config for dotfiles [\#344](https://github.com/voxpupuli/puppet-python/pull/344) ([puppetninja](https://github.com/puppetninja))
- Ensure value is a string for =~ comparison [\#342](https://github.com/voxpupuli/puppet-python/pull/342) ([ghoneycutt](https://github.com/ghoneycutt))
- add an alias to the python-dev package [\#334](https://github.com/voxpupuli/puppet-python/pull/334) ([dannygoulder](https://github.com/dannygoulder))

Expand All @@ -276,7 +301,7 @@ These should not affect the functionality of the module.

## [1.18.1](https://github.com/voxpupuli/puppet-python/tree/1.18.1) (2016-12-08)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.4.2...1.18.1)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.18.0...1.18.1)

**Closed issues:**

Expand All @@ -288,23 +313,15 @@ These should not affect the functionality of the module.
- Add name of package to pip uninstall command [\#340](https://github.com/voxpupuli/puppet-python/pull/340) ([dontreboot](https://github.com/dontreboot))
- EPEL only makes sense on RH systems but not Fedora [\#297](https://github.com/voxpupuli/puppet-python/pull/297) ([jcpunk](https://github.com/jcpunk))

## [2.4.2](https://github.com/voxpupuli/puppet-python/tree/2.4.2) (2016-10-28)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.18.0...2.4.2)

## [1.18.0](https://github.com/voxpupuli/puppet-python/tree/1.18.0) (2016-10-12)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.4.1...1.18.0)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.17.0...1.18.0)

**Merged pull requests:**

- Allow failure for Ruby 2.3.1 [\#337](https://github.com/voxpupuli/puppet-python/pull/337) ([ghoneycutt](https://github.com/ghoneycutt))
- Add support, tests and documentation for Gentoo [\#335](https://github.com/voxpupuli/puppet-python/pull/335) ([optiz0r](https://github.com/optiz0r))

## [2.4.1](https://github.com/voxpupuli/puppet-python/tree/2.4.1) (2016-09-19)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.17.0...2.4.1)

## [1.17.0](https://github.com/voxpupuli/puppet-python/tree/1.17.0) (2016-09-16)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.16.0...1.17.0)
Expand All @@ -320,24 +337,12 @@ These should not affect the functionality of the module.

## [1.16.0](https://github.com/voxpupuli/puppet-python/tree/1.16.0) (2016-09-10)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.4.0...1.16.0)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.15.0...1.16.0)

**Merged pull requests:**

- RHSCL Repository installation made optional [\#328](https://github.com/voxpupuli/puppet-python/pull/328) ([diLLec](https://github.com/diLLec))

## [2.4.0](https://github.com/voxpupuli/puppet-python/tree/2.4.0) (2016-09-04)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.3.1...2.4.0)

## [2.3.1](https://github.com/voxpupuli/puppet-python/tree/2.3.1) (2016-08-29)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.3.0...2.3.1)

## [2.3.0](https://github.com/voxpupuli/puppet-python/tree/2.3.0) (2016-08-29)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.15.0...2.3.0)

## [1.15.0](https://github.com/voxpupuli/puppet-python/tree/1.15.0) (2016-08-24)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.14.2...1.15.0)
Expand Down Expand Up @@ -374,16 +379,12 @@ These should not affect the functionality of the module.

## [1.14.0](https://github.com/voxpupuli/puppet-python/tree/1.14.0) (2016-07-20)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.2.1...1.14.0)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.13.0...1.14.0)

**Merged pull requests:**

- Fix regex for pip package versions [\#317](https://github.com/voxpupuli/puppet-python/pull/317) ([mdean](https://github.com/mdean))

## [2.2.1](https://github.com/voxpupuli/puppet-python/tree/2.2.1) (2016-07-20)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.13.0...2.2.1)

## [1.13.0](https://github.com/voxpupuli/puppet-python/tree/1.13.0) (2016-07-18)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.2.0...1.13.0)
Expand All @@ -408,23 +409,7 @@ These should not affect the functionality of the module.

## [2.2.0](https://github.com/voxpupuli/puppet-python/tree/2.2.0) (2016-05-31)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.1.0...2.2.0)

## [2.1.0](https://github.com/voxpupuli/puppet-python/tree/2.1.0) (2016-05-29)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.0.2...2.1.0)

## [2.0.2](https://github.com/voxpupuli/puppet-python/tree/2.0.2) (2016-05-22)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.0.1...2.0.2)

## [2.0.1](https://github.com/voxpupuli/puppet-python/tree/2.0.1) (2016-05-19)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/2.0.0...2.0.1)

## [2.0.0](https://github.com/voxpupuli/puppet-python/tree/2.0.0) (2016-05-19)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.12.0...2.0.0)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.12.0...2.2.0)

**Closed issues:**

Expand Down Expand Up @@ -494,12 +479,13 @@ These should not affect the functionality of the module.

## [1.9.8](https://github.com/voxpupuli/puppet-python/tree/1.9.8) (2015-09-19)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.9.7...1.9.8)
[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.9.6...1.9.8)

**Closed issues:**

- Unable to install pip using pip provider [\#243](https://github.com/voxpupuli/puppet-python/issues/243)
- Not possible to install latest version of Python [\#240](https://github.com/voxpupuli/puppet-python/issues/240)
- Exec\<| tag == 'python-virtualenv' |\> changes and breaks the API [\#230](https://github.com/voxpupuli/puppet-python/issues/230)

**Merged pull requests:**

Expand All @@ -514,14 +500,6 @@ These should not affect the functionality of the module.
- Check that we have results before returning a value [\#238](https://github.com/voxpupuli/puppet-python/pull/238) ([xaque208](https://github.com/xaque208))
- Adjust test code to pass syntax checker [\#237](https://github.com/voxpupuli/puppet-python/pull/237) ([fluential](https://github.com/fluential))

## [1.9.7](https://github.com/voxpupuli/puppet-python/tree/1.9.7) (2015-08-21)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.9.6...1.9.7)

**Closed issues:**

- Exec\<| tag == 'python-virtualenv' |\> changes and breaks the API [\#230](https://github.com/voxpupuli/puppet-python/issues/230)

## [1.9.6](https://github.com/voxpupuli/puppet-python/tree/1.9.6) (2015-08-01)

[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.9.5...1.9.6)
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'voxpupuli-test', '>= 1.0.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'voxpupuli-test', '~> 2.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
end

group :development do
Expand Down
23 changes: 20 additions & 3 deletions lib/facter/pip_version.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Make pip version available as a fact

def get_pip_version(executable)
if Facter::Util::Resolution.which(executable) # rubocop:disable Style/GuardClause
results = Facter::Util::Resolution.exec("#{executable} --version 2>&1").match(%r{^pip (\d+\.\d+\.?\d*).*$})
results[1] if results
end
end

Facter.add('pip_version') do
setcode do
if Facter::Util::Resolution.which('pip')
Facter::Util::Resolution.exec('pip --version 2>&1').match(%r{^pip (\d+\.\d+\.?\d*).*$})[1]
end
get_pip_version 'pip'
end
end

Facter.add('pip2_version') do
setcode do
get_pip_version 'pip2'
end
end

Facter.add('pip3_version') do
setcode do
get_pip_version 'pip3'
end
end
3 changes: 2 additions & 1 deletion lib/facter/virtualenv_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Facter.add('virtualenv_version') do
setcode do
if Facter::Util::Resolution.which('virtualenv')
Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})[1]
results = Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$})
results[1] if results
end
end
end
2 changes: 0 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# include python::config
#
class python::config {

Class['python::install'] -> Python::Pip <| |>
Class['python::install'] -> Python::Requirements <| |>
Class['python::install'] -> Python::Virtualenv <| |>
Expand All @@ -27,5 +26,4 @@
}
}
}

}
2 changes: 1 addition & 1 deletion manifests/dotfile.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

exec { "create ${title}'s parent dir":
command => "install -o ${owner} -g ${group} -d ${parent_dir}",
path => [ '/usr/bin', '/bin', '/usr/local/bin', ],
path => ['/usr/bin', '/bin', '/usr/local/bin',],
creates => $parent_dir,
}

Expand Down
1 change: 0 additions & 1 deletion manifests/gunicorn.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@
content => template($template),
}
}

}
16 changes: 7 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,31 @@
$gunicorn_package_name = $python::params::gunicorn_package_name,
Optional[Enum['pip', 'scl', 'rhscl', 'anaconda', '']] $provider = $python::params::provider,
$valid_versions = $python::params::valid_versions,
Hash $python_pips = { },
Hash $python_virtualenvs = { },
Hash $python_pyvenvs = { },
Hash $python_requirements = { },
Hash $python_dotfiles = { },
Hash $python_pips = {},
Hash $python_virtualenvs = {},
Hash $python_pyvenvs = {},
Hash $python_requirements = {},
Hash $python_dotfiles = {},
Boolean $use_epel = $python::params::use_epel,
$rhscl_use_public_repository = $python::params::rhscl_use_public_repository,
Stdlib::Httpurl $anaconda_installer_url = $python::params::anaconda_installer_url,
Stdlib::Absolutepath $anaconda_install_path = $python::params::anaconda_install_path,
Boolean $manage_scl = $python::params::manage_scl,
Optional[Pattern[/[0-7]{1,4}/]] $umask = undef,
) inherits python::params {

$exec_prefix = $provider ? {
'scl' => "/usr/bin/scl enable ${version} -- ",
'rhscl' => "/usr/bin/scl enable ${version} -- ",
default => '',
}

unless $version =~ Pattern[/\A(python)?[0-9](\.?[0-9])*/,
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
/\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] {
fail("version needs to be pypy, system or a version string like '36', '3.6' or 'python3.6' )")
}

# Module compatibility check
$compatible = [ 'Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX' ]
$compatible = ['Debian', 'RedHat', 'Suse', 'Gentoo', 'AIX']
if ! ($facts['os']['family'] in $compatible) {
fail("Module is not compatible with ${facts['os']['name']}")
}
Expand All @@ -96,5 +95,4 @@
create_resources('python::virtualenv', $python_virtualenvs)
create_resources('python::requirements', $python_requirements)
create_resources('python::dotfile', $python_dotfiles)

}
Loading