# HG changeset patch # User IBBoard # Date 1641229986 0 # Node ID 66c075c5f54ace3e95fc00fd180d37f9852a978d # Parent 3fce34f642f1bc50b8acb9941ecd79a9f57edbc0 Update to newer Python module diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/CHANGELOG.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/CHANGELOG.md Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,118 @@ +# Changelog + +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. + +## [v3.1.0](https://github.com/voxpupuli/puppet-epel/tree/v3.1.0) (2021-07-23) + +[Full Changelog](https://github.com/voxpupuli/puppet-epel/compare/v3.0.1...v3.1.0) + +**Implemented enhancements:** + +- Enable Puppet 7 support [\#125](https://github.com/voxpupuli/puppet-epel/pull/125) ([bastelfreak](https://github.com/bastelfreak)) +- Add username/password params for each yumrepo [\#123](https://github.com/voxpupuli/puppet-epel/pull/123) ([cdenneen](https://github.com/cdenneen)) + +**Merged pull requests:** + +- update README.md badges [\#127](https://github.com/voxpupuli/puppet-epel/pull/127) ([bastelfreak](https://github.com/bastelfreak)) +- Drop EL5 support [\#122](https://github.com/voxpupuli/puppet-epel/pull/122) ([ekohl](https://github.com/ekohl)) + +## [v3.0.1](https://github.com/voxpupuli/puppet-epel/tree/v3.0.1) (2020-03-28) + +[Full Changelog](https://github.com/voxpupuli/puppet-epel/compare/v3.0.0...v3.0.1) + +**Fixed bugs:** + +- Fix compilation on Fedora [\#116](https://github.com/voxpupuli/puppet-epel/pull/116) ([alexjfisher](https://github.com/alexjfisher)) + +## [v3.0.0](https://github.com/voxpupuli/puppet-epel/tree/v3.0.0) (2020-02-20) + +[Full Changelog](https://github.com/voxpupuli/puppet-epel/compare/2.0.0...v3.0.0) + +This is the first release of this module under [Vox Pupuli](https://voxpupuli.org/)'s [puppet](https://forge.puppet.com/puppet) namespace. It was migrated to Vox Pupuli from [stahnma/epel](https://forge.puppet.com/stahnma/epel). + +In line with Vox Pupuli [policy](https://voxpupuli.org/blog/2019/01/03/dropping-puppet4/), this release no longer supports Puppet 3 or 4. Support for EL5 has also been deprecated. + +**Breaking changes:** + +- Drop support for Puppet 3 and 4 [\#109](https://github.com/voxpupuli/puppet-epel/pull/109) ([alexjfisher](https://github.com/alexjfisher)) + +**Implemented enhancements:** + +- Add best effort support for Amazon Linux 2016,2018 [\#112](https://github.com/voxpupuli/puppet-epel/pull/112) ([alexjfisher](https://github.com/alexjfisher)) +- Make gpg command more resilient by using --with-colons [\#90](https://github.com/voxpupuli/puppet-epel/pull/90) ([fschaer](https://github.com/fschaer)) + +**Fixed bugs:** + +- Module does not allow the management on Amazon Linux [\#77](https://github.com/voxpupuli/puppet-epel/issues/77) +- Make sure the GPG key is imported before Yum repositories are created [\#86](https://github.com/voxpupuli/puppet-epel/pull/86) ([hlaf](https://github.com/hlaf)) + +**Closed issues:** + +- Add working acceptance tests [\#106](https://github.com/voxpupuli/puppet-epel/issues/106) +- Add compatibility with RHEL8/CentOS 8 [\#91](https://github.com/voxpupuli/puppet-epel/issues/91) +- Module does not expose the repo\_gpgcheck parameter [\#76](https://github.com/voxpupuli/puppet-epel/issues/76) +- Update to be a Puppet4/5 module. [\#70](https://github.com/voxpupuli/puppet-epel/issues/70) + +**Merged pull requests:** + +- Replace erb `templates` with `files` [\#113](https://github.com/voxpupuli/puppet-epel/pull/113) ([alexjfisher](https://github.com/alexjfisher)) +- Remove use of getvar and stdlib dependency [\#110](https://github.com/voxpupuli/puppet-epel/pull/110) ([alexjfisher](https://github.com/alexjfisher)) +- Get acceptance tests running [\#107](https://github.com/voxpupuli/puppet-epel/pull/107) ([alexjfisher](https://github.com/alexjfisher)) +- Update metadata.json for Vox Pupuli migration [\#103](https://github.com/voxpupuli/puppet-epel/pull/103) ([alexjfisher](https://github.com/alexjfisher)) +- Remove `tests` directory [\#102](https://github.com/voxpupuli/puppet-epel/pull/102) ([alexjfisher](https://github.com/alexjfisher)) +- Migrate changelog from README to HISTORY.md [\#101](https://github.com/voxpupuli/puppet-epel/pull/101) ([alexjfisher](https://github.com/alexjfisher)) +- Fix github license detection [\#100](https://github.com/voxpupuli/puppet-epel/pull/100) ([alexjfisher](https://github.com/alexjfisher)) +- Add badges to README [\#99](https://github.com/voxpupuli/puppet-epel/pull/99) ([alexjfisher](https://github.com/alexjfisher)) + +## 2.0.0 (2020-02-13) + +- Allow this module to work on systems when global `repo_gpgcheck` = 1 [#82](https://github.com/voxpupuli/puppet-epel/pull/82) +- Amazon Linux 2 - bugfix - use enterprise linux 7 [#95](https://github.com/voxpupuli/puppet-epel/pull/95) +- Add support for RHEL 8 and CentOS 8 [#92](https://github.com/voxpupuli/puppet-epel/pull/92) +- Adjust gpg args to account for slightly different display. [#84](https://github.com/voxpupuli/puppet-epel/pull/84) + +## 1.3.1 (2018-07-16) + +- Remove an `Epel::Rpm_gpg_key` collector that could cause circular dependencies + +## 1.3.0 (2017-10-24) + +- Add ability to disable and not define any resources from this module. This is useful if another module pulls in this module, but you already have epel managed another way. +- Ability to specify your own TLS certs +- repo files are now templated instead of sourced. +- properly use metalink vs mirrorlist + +## 1.2.2 (2015-12-05) + +- Add dep on stdlib for getvar function call + +## 1.2.1 (2015-12-05) +- Minor fix that lets facter 1.6 still work +- Enforce strict variables + +## 1.2.0 (2015-12-01) + +- Rework testing to use TravisCI +- If you specify a baseurl, disable mirrorlist + +## 1.1.1 (2015-08-28) + +- Ensure that GPG keys are using short IDs (issue #33) + +## 1.1.0 (2015-08-21) + +- Default URLs to be https +- Add ability to include/exclude packages + +## 1.0.2 (2014-12-12) + +- Update README with usage section. +- Fix regression when `os_maj_version` fact was required +- Ready for 1.0 - replace Modulefile with metadata.json +- Replace `os_maj_version` custom fact with operatingsystemmajrelease +- Works for EPEL7 now as well. + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/Gemfile --- a/modules/epel/Gemfile Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -source "https://rubygems.org" - -group :test do - gem 'puppetlabs_spec_helper', '~> 2.1.1' - gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 4.0.0' - gem 'rspec-puppet', '~> 2.5' - gem 'rspec-puppet-facts' - gem 'puppet-lint-absolute_classname-check' - gem 'puppet-lint-leading_zero-check' - gem 'puppet-lint-trailing_comma-check' - gem 'puppet-lint-version_comparison-check' - gem 'puppet-lint-classes_and_types_beginning_with_digits-check' - gem 'puppet-lint-unquoted_string-check' - gem 'metadata-json-lint' - gem 'puppet-blacksmith' - gem 'rubocop', '0.48.0' - gem 'rubocop-rspec', '~> 1.15.0' - gem 'simplecov-console' - -end - -group :development do - gem 'travis' - gem 'travis-lint' - gem 'guard-rake' -end - -group :system_tests do - gem 'beaker' - gem 'beaker-rspec' - gem 'beaker-puppet_install_helper' -end - diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/Gemfile.lock --- a/modules/epel/Gemfile.lock Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,410 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (2.3.6) - addressable (2.5.2) - public_suffix (>= 2.0.2, < 4.0) - ansi (1.5.0) - ast (2.4.0) - aws-eventstream (1.0.1) - aws-partitions (1.96.0) - aws-sdk-core (3.22.1) - aws-eventstream (~> 1.0) - aws-partitions (~> 1.0) - aws-sigv4 (~> 1.0) - jmespath (~> 1.0) - aws-sdk-ec2 (1.38.0) - aws-sdk-core (~> 3) - aws-sigv4 (~> 1.0) - aws-sigv4 (1.0.3) - backports (3.11.3) - beaker (3.37.0) - beaker-abs (~> 0.4) - beaker-aws (~> 0.1) - beaker-docker (~> 0.1) - beaker-google (~> 0.1) - beaker-hiera (~> 0.0) - beaker-hostgenerator - beaker-openstack (~> 0.1) - beaker-puppet (~> 0.0) - beaker-vagrant (~> 0.1) - beaker-vcloud (~> 0.1) - beaker-vmpooler (~> 1.0) - beaker-vmware (~> 0.1) - hocon (~> 1.0) - in-parallel (~> 0.1) - inifile (~> 3.0) - minitar (~> 0.6) - minitest (~> 5.4) - net-scp (~> 1.2) - net-ssh (~> 4.0) - open_uri_redirections (~> 0.2.1) - pry-byebug (~> 3.4.2) - rb-readline (~> 0.5.3) - rsync (~> 1.0.9) - stringify-hash (~> 0.0) - thor (~> 0.19) - beaker-abs (0.5.0) - beaker-aws (0.5.0) - aws-partitions (~> 1.91) - aws-sdk-ec2 (~> 1.35) - stringify-hash (~> 0.0.0) - beaker-docker (0.3.3) - docker-api - stringify-hash (~> 0.0.0) - beaker-google (0.1.0) - google-api-client (~> 0.9) - stringify-hash (~> 0.0.0) - beaker-hiera (0.1.1) - stringify-hash (~> 0.0.0) - beaker-hostgenerator (1.1.14) - deep_merge (~> 1.0) - stringify-hash (~> 0.0.0) - beaker-openstack (0.2.0) - fog-openstack - stringify-hash (~> 0.0.0) - beaker-puppet (0.16.0) - in-parallel (~> 0.1) - oga - stringify-hash (~> 0.0.0) - beaker-puppet_install_helper (0.9.4) - beaker (>= 2.0) - beaker-rspec (6.2.3) - beaker (~> 3.0) - rspec (~> 3.0) - serverspec (~> 2) - specinfra (~> 2) - beaker-vagrant (0.5.0) - stringify-hash (~> 0.0.0) - beaker-vcloud (0.3.0) - beaker-vmpooler - beaker-vmware - rbvmomi (~> 1.9) - stringify-hash (~> 0.0.0) - beaker-vmpooler (1.2.0) - stringify-hash (~> 0.0.0) - beaker-vmware (0.2.0) - fission (~> 0.4) - rbvmomi (~> 1.9) - stringify-hash (~> 0.0.0) - builder (3.2.3) - byebug (9.0.6) - coderay (1.1.2) - connection_pool (2.2.2) - declarative (0.0.10) - declarative-option (0.1.0) - deep_merge (1.2.1) - diff-lcs (1.3) - docile (1.3.1) - docker-api (1.34.2) - excon (>= 0.47.0) - multi_json - domain_name (0.5.20180417) - unf (>= 0.0.5, < 1.0.0) - ethon (0.11.0) - ffi (>= 1.3.0) - excon (0.62.0) - facter (2.5.1) - facterdb (0.5.2) - facter - jgrep - faraday (0.15.2) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.12.2) - faraday (>= 0.7.4, < 1.0) - ffi (1.9.25) - fission (0.5.0) - CFPropertyList (~> 2.2) - fog-core (1.45.0) - builder - excon (~> 0.58) - formatador (~> 0.2) - fog-json (1.2.0) - fog-core - multi_json (~> 1.10) - fog-openstack (0.1.27) - fog-core (~> 1.45.0) - fog-json (>= 1.0) - ipaddress (>= 0.8) - formatador (0.2.5) - gh (0.14.0) - addressable - backports - faraday (~> 0.8) - multi_json (~> 1.0) - net-http-persistent (>= 2.7) - net-http-pipeline - google-api-client (0.23.4) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.5, < 0.7.0) - httpclient (>= 2.8.1, < 3.0) - mime-types (~> 3.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.0) - googleauth (0.6.2) - faraday (~> 0.12) - jwt (>= 1.4, < 3.0) - logging (~> 2.0) - memoist (~> 0.12) - multi_json (~> 1.11) - os (~> 0.9) - signet (~> 0.7) - guard (2.14.2) - formatador (>= 0.2.4) - listen (>= 2.7, < 4.0) - lumberjack (>= 1.0.12, < 2.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.9.12) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-rake (1.0.0) - guard - rake - hiera (2.0.0) - json_pure - highline (1.7.10) - hirb (0.7.3) - hocon (1.2.5) - http-cookie (1.0.3) - domain_name (~> 0.5) - httpclient (2.8.3) - in-parallel (0.1.17) - inifile (3.0.0) - ipaddress (0.8.3) - jgrep (1.5.0) - jmespath (1.4.0) - json (2.1.0) - json-schema (2.8.0) - addressable (>= 2.4) - json_pure (2.1.0) - jwt (2.1.0) - launchy (2.4.3) - addressable (~> 2.3) - listen (3.1.5) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - ruby_dep (~> 1.2) - little-plugger (1.1.4) - logging (2.2.2) - little-plugger (~> 1.1) - multi_json (~> 1.10) - lumberjack (1.0.13) - mcollective-client (2.12.1) - json - stomp - systemu - memoist (0.16.0) - metaclass (0.0.4) - metadata-json-lint (2.1.0) - json-schema (~> 2.8) - spdx-licenses (~> 1.0) - method_source (0.9.0) - mime-types (3.1) - mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_portile2 (2.3.0) - minitar (0.6.1) - minitest (5.11.3) - mocha (1.5.0) - metaclass (~> 0.0.1) - multi_json (1.13.1) - multipart-post (2.0.0) - nenv (0.3.0) - net-http-persistent (3.0.0) - connection_pool (~> 2.2) - net-http-pipeline (1.0.1) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (4.2.0) - net-telnet (0.1.1) - netrc (0.11.0) - nokogiri (1.8.4) - mini_portile2 (~> 2.3.0) - notiffany (0.1.1) - nenv (~> 0.1) - shellany (~> 0.0) - oga (2.15) - ast - ruby-ll (~> 2.1) - open_uri_redirections (0.2.1) - os (0.9.6) - parser (2.5.1.2) - ast (~> 2.4.0) - powerpack (0.1.2) - pry (0.11.3) - coderay (~> 1.1.0) - method_source (~> 0.9.0) - pry-byebug (3.4.3) - byebug (>= 9.0, < 9.1) - pry (~> 0.10) - public_suffix (3.0.2) - puppet (4.0.0) - facter (> 2.0, < 4) - hiera (>= 2.0, < 3) - json_pure - puppet-blacksmith (4.1.2) - rest-client (~> 2.0) - puppet-lint (2.3.6) - puppet-lint-absolute_classname-check (0.2.5) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-classes_and_types_beginning_with_digits-check (0.1.2) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-leading_zero-check (0.1.1) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-trailing_comma-check (0.3.2) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-unquoted_string-check (0.3.0) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-version_comparison-check (0.2.1) - puppet-lint (>= 1.0, < 3.0) - puppet-syntax (2.4.1) - rake - puppetlabs_spec_helper (2.1.5) - mocha (~> 1.0) - puppet-lint (~> 2.0) - puppet-syntax (~> 2.0) - rspec-puppet (~> 2.0) - pusher-client (0.6.2) - json - websocket (~> 1.0) - rainbow (2.2.2) - rake - rake (12.3.1) - rb-fsevent (0.10.3) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) - rb-readline (0.5.5) - rbvmomi (1.13.0) - builder (~> 3.0) - json (>= 1.8) - nokogiri (~> 1.5) - trollop (~> 2.1) - representable (3.0.4) - declarative (< 0.1.0) - declarative-option (< 0.2.0) - uber (< 0.2.0) - rest-client (2.0.2) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 4.0) - netrc (~> 0.8) - retriable (3.1.2) - rspec (3.7.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-core (3.7.1) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-its (1.2.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.7.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-puppet (2.6.14) - rspec - rspec-puppet-facts (1.9.0) - facter - facterdb (>= 0.5.0) - json - mcollective-client - puppet - rspec-support (3.7.1) - rsync (1.0.9) - rubocop (0.48.0) - parser (>= 2.3.3.1, < 3.0) - powerpack (~> 0.1) - rainbow (>= 1.99.1, < 3.0) - ruby-progressbar (~> 1.7) - unicode-display_width (~> 1.0, >= 1.0.1) - rubocop-rspec (1.15.1) - rubocop (>= 0.42.0) - ruby-ll (2.1.2) - ansi - ast - ruby-progressbar (1.9.0) - ruby_dep (1.5.0) - serverspec (2.41.3) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.72) - sfl (2.3) - shellany (0.0.1) - signet (0.8.1) - addressable (~> 2.3) - faraday (~> 0.9) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simplecov (0.16.1) - docile (~> 1.1) - json (>= 1.8, < 3) - simplecov-html (~> 0.10.0) - simplecov-console (0.4.2) - ansi - hirb - simplecov - simplecov-html (0.10.2) - spdx-licenses (1.2.0) - specinfra (2.75.0) - net-scp - net-ssh (>= 2.7) - net-telnet - sfl - stomp (1.4.4) - stringify-hash (0.0.2) - systemu (2.6.5) - thor (0.20.0) - travis (1.8.8) - backports - faraday (~> 0.9) - faraday_middleware (~> 0.9, >= 0.9.1) - gh (~> 0.13) - highline (~> 1.6) - launchy (~> 2.1) - pusher-client (~> 0.4) - typhoeus (~> 0.6, >= 0.6.8) - travis-lint (2.0.0) - json - trollop (2.1.3) - typhoeus (0.8.0) - ethon (>= 0.8.0) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.5) - unicode-display_width (1.4.0) - websocket (1.2.8) - -PLATFORMS - ruby - -DEPENDENCIES - beaker - beaker-puppet_install_helper - beaker-rspec - guard-rake - metadata-json-lint - puppet (~> 4.0.0) - puppet-blacksmith - puppet-lint-absolute_classname-check - puppet-lint-classes_and_types_beginning_with_digits-check - puppet-lint-leading_zero-check - puppet-lint-trailing_comma-check - puppet-lint-unquoted_string-check - puppet-lint-version_comparison-check - puppetlabs_spec_helper (~> 2.1.1) - rake - rspec-puppet (~> 2.5) - rspec-puppet-facts - rubocop (= 0.48.0) - rubocop-rspec (~> 1.15.0) - simplecov-console - travis - travis-lint - -BUNDLED WITH - 1.16.1 diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/HISTORY.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/HISTORY.md Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,47 @@ +## 2.0.0 (2020-02-13) + +- Allow this module to work on systems when global `repo_gpgcheck` = 1 [#82](https://github.com/voxpupuli/puppet-epel/pull/82) +- Amazon Linux 2 - bugfix - use enterprise linux 7 [#95](https://github.com/voxpupuli/puppet-epel/pull/95) +- Add support for RHEL 8 and CentOS 8 [#92](https://github.com/voxpupuli/puppet-epel/pull/92) +- Adjust gpg args to account for slightly different display. [#84](https://github.com/voxpupuli/puppet-epel/pull/84) + +## 1.3.1 (2018-07-16) + +- Remove an `Epel::Rpm_gpg_key` collector that could cause circular dependencies + +## 1.3.0 (2017-10-24) + +- Add ability to disable and not define any resources from this module. This is useful if another module pulls in this module, but you already have epel managed another way. +- Ability to specify your own TLS certs +- repo files are now templated instead of sourced. +- properly use metalink vs mirrorlist + +## 1.2.2 (2015-12-05) + +- Add dep on stdlib for getvar function call + +## 1.2.1 (2015-12-05) +- Minor fix that lets facter 1.6 still work +- Enforce strict variables + +## 1.2.0 (2015-12-01) + +- Rework testing to use TravisCI +- If you specify a baseurl, disable mirrorlist + +## 1.1.1 (2015-08-28) + +- Ensure that GPG keys are using short IDs (issue #33) + +## 1.1.0 (2015-08-21) + +- Default URLs to be https +- Add ability to include/exclude packages + +## 1.0.2 (2014-12-12) + +- Update README with usage section. +- Fix regression when `os_maj_version` fact was required +- Ready for 1.0 - replace Modulefile with metadata.json +- Replace `os_maj_version` custom fact with operatingsystemmajrelease +- Works for EPEL7 now as well. diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/LICENSE --- a/modules/epel/LICENSE Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/LICENSE Mon Jan 03 17:13:06 2022 +0000 @@ -1,13 +1,203 @@ Copyright 2012-2014 Michael Stahnke -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. - http://www.apache.org/licenses/LICENSE-2.0 + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/README.md --- a/modules/epel/README.md Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/README.md Mon Jan 03 17:13:06 2022 +0000 @@ -1,8 +1,13 @@ # Configure EPEL (Extra Repository for Enterprise Linux) -# Note - -This is the last release that will support anything before Puppet 4. +[![Build Status](https://github.com/voxpupuli/puppet-epel/workflows/CI/badge.svg)](https://github.com/voxpupuli/puppet-epel/actions?query=workflow%3ACI) +[![Release](https://github.com/voxpupuli/puppet-epel/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-epel/actions/workflows/release.yml) +[![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/epel.svg)](https://forge.puppetlabs.com/puppet/epel) +[![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/epel.svg)](https://forge.puppetlabs.com/puppet/epel) +[![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/epel.svg)](https://forge.puppetlabs.com/puppet/epel) +[![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/epel.svg)](https://forge.puppetlabs.com/puppet/epel) +[![puppetmodule.info docs](http://www.puppetmodule.info/images/badge.png)](http://www.puppetmodule.info/m/puppet-epel) +[![AGPL v3 License](https://img.shields.io/github/license/voxpupuli/puppet-epel.svg)](LICENSE) # About This module basically just mimics the epel-release rpm. The same repos are @@ -28,6 +33,8 @@ the default settings for the epel repository such as having your own mirror, an http proxy, or disable gpg checking. +A list of all parameters is available in [REFERENCE.md](REFERENCE.md). + You can also use a puppet one-liner to get epel onto a system. puppet apply -e 'include epel' @@ -58,59 +65,12 @@ * [EPEL Wiki](http://fedoraproject.org/wiki/EPEL) * [epel-release package information](http://mirrors.servercentral.net/fedora/epel/6/i386/repoview/epel-release.html) -# ChangeLog - -======= - -1.3.1 - * Remove an Epel::Rpm_gpg_key collector that could cause circular dependencies - -1.3.0 - * Add ability to disable and not define any resources from this module. This is useful if another module pulls in this module, but you already have epel managed another way. - * Ability to specify your own TLS certs - * repo files are now templated instead of sourced. - * properly use metalink vs mirrorlist - - 1.2.2 - * Add dep on stdlib for getvar function call - - 1.2.1 - * Minor fix that lets facter 1.6 still work - * Enforce strict variables - - 1.2.0 - * Rework testing to use TravisCI - * If you specify a baseurl, disable mirrorlist - - 1.1.1 - * Ensure that GPG keys are using short IDs (issue #33) +# Testing and Compatibility - 1.1.0 - * Default URLs to be https - * Add ability to include/exclude packages - - 1.0.2 - * Update README with usage section. - * Fix regression when os_maj_version fact was required - * Ready for 1.0 - replace Modulefile with metadata.json - * Replace os_maj_version custom fact with operatingsystemmajrelease - * Works for EPEL7 now as well. - -# Testing - - * This is commonly used on Puppet Enterprise 3.x - * This was tested using Puppet 3.3.0 on Centos5/6 - * This was tested using Puppet 3.1.1 on Amazon's AWS Linux - * This was tested using Puppet 3.8 and Puppet 4 now as well! - * Note Ruby 2.2 and Puppet 3.8 are not yet friends. - * I assume it will work on any RHEL variant (Amazon Linux is debatable as a variant) - * Amazon Linux compatability not promised, as EPEL doesn't always work with it. - -# Lifecycle - - * No functionality has been introduced that should break Puppet 2.6 or 2.7, but I am no longer testing these versions of Puppet as they are end-of-lifed from Puppet Labs. - * This also assumes a facter of greater than 1.7.0 -- at least from a testing perspective. - * I'm not actively fixing bugs for anything in facter < 2 or puppet < 3.8 +* This module is tested on CentOS 6, 7 and 8 with Puppet 5 and Puppet 6. +* It should work on any RHEL variant such as RedHat, OracleLinux, Scientific Linux etc. +* Amazon Linux compatability is not promised, as EPEL doesn't always work with it. +* Support for EL5 is deprecated. It *may* still work but we have no acceptance tests. CentOS 5 is EOL and RHEL5 and OracleLinux 5 extended support for most customers is due to end in 2020. ## Unit tests @@ -131,7 +91,9 @@ Available RSPEC_SET options are in .nodeset.yml # License -Apache Software License 2.0 + +This module is distributed under the [Apache License 2.0](LICENSE). +Since version 3, it is maintained by [Vox Pupuli](https://voxpupuli.org/). # Author/Contributors * Aaron @@ -153,6 +115,7 @@ * Riccardo Calixte * Robert Story * Rob Nelson + * Siebrand Mazeland * Stefan Goethals * Tim Rupp * Toni Schmidbauer @@ -161,4 +124,4 @@ * Vlastimil Holer # Alternatives -If you're on CentOS 7, you can just `yum install epel-release` as it's in centos-extras. +If you're on CentOS 7 or CentOS 8, you can just `yum install epel-release` as it's in centos-extras. diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/REFERENCE.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/REFERENCE.md Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,877 @@ +# Reference + + + +## Table of Contents + +### Classes + +#### Public Classes + +* [`epel`](#epel): Configure the proper EPEL repositories and import GPG keys + +#### Private Classes + +* `epel::params` + +### Defined types + +#### Public Defined types + + +#### Private Defined types + +* `epel::rpm_gpg_key`: Import an RPM gpg key + +## Classes + +### `epel` + +Configure the proper EPEL repositories and import GPG keys + +* **See also** + * https://fedoraproject.org/wiki/EPEL + +#### Examples + +##### Basic Usage + +```puppet +include epel +``` + +#### Parameters + +The following parameters are available in the `epel` class: + +* [`epel_managed`](#epel_managed) +* [`epel_source_managed`](#epel_source_managed) +* [`epel_debuginfo_managed`](#epel_debuginfo_managed) +* [`epel_testing_managed`](#epel_testing_managed) +* [`epel_testing_source_managed`](#epel_testing_source_managed) +* [`epel_testing_debuginfo_managed`](#epel_testing_debuginfo_managed) +* [`epel_gpg_managed`](#epel_gpg_managed) +* [`epel_mirrorlist`](#epel_mirrorlist) +* [`epel_baseurl`](#epel_baseurl) +* [`epel_failovermethod`](#epel_failovermethod) +* [`epel_proxy`](#epel_proxy) +* [`epel_enabled`](#epel_enabled) +* [`epel_gpgcheck`](#epel_gpgcheck) +* [`epel_repo_gpgcheck`](#epel_repo_gpgcheck) +* [`epel_metalink`](#epel_metalink) +* [`epel_exclude`](#epel_exclude) +* [`epel_includepkgs`](#epel_includepkgs) +* [`epel_sslclientkey`](#epel_sslclientkey) +* [`epel_sslclientcert`](#epel_sslclientcert) +* [`epel_username`](#epel_username) +* [`epel_password`](#epel_password) +* [`epel_testing_mirrorlist`](#epel_testing_mirrorlist) +* [`epel_testing_baseurl`](#epel_testing_baseurl) +* [`epel_testing_failovermethod`](#epel_testing_failovermethod) +* [`epel_testing_proxy`](#epel_testing_proxy) +* [`epel_testing_enabled`](#epel_testing_enabled) +* [`epel_testing_gpgcheck`](#epel_testing_gpgcheck) +* [`epel_testing_repo_gpgcheck`](#epel_testing_repo_gpgcheck) +* [`epel_testing_metalink`](#epel_testing_metalink) +* [`epel_testing_exclude`](#epel_testing_exclude) +* [`epel_testing_includepkgs`](#epel_testing_includepkgs) +* [`epel_testing_sslclientkey`](#epel_testing_sslclientkey) +* [`epel_testing_sslclientcert`](#epel_testing_sslclientcert) +* [`epel_testing_username`](#epel_testing_username) +* [`epel_testing_password`](#epel_testing_password) +* [`epel_source_mirrorlist`](#epel_source_mirrorlist) +* [`epel_source_baseurl`](#epel_source_baseurl) +* [`epel_source_failovermethod`](#epel_source_failovermethod) +* [`epel_source_proxy`](#epel_source_proxy) +* [`epel_source_enabled`](#epel_source_enabled) +* [`epel_source_gpgcheck`](#epel_source_gpgcheck) +* [`epel_source_repo_gpgcheck`](#epel_source_repo_gpgcheck) +* [`epel_source_metalink`](#epel_source_metalink) +* [`epel_source_exclude`](#epel_source_exclude) +* [`epel_source_includepkgs`](#epel_source_includepkgs) +* [`epel_source_sslclientkey`](#epel_source_sslclientkey) +* [`epel_source_sslclientcert`](#epel_source_sslclientcert) +* [`epel_source_username`](#epel_source_username) +* [`epel_source_password`](#epel_source_password) +* [`epel_debuginfo_mirrorlist`](#epel_debuginfo_mirrorlist) +* [`epel_debuginfo_baseurl`](#epel_debuginfo_baseurl) +* [`epel_debuginfo_failovermethod`](#epel_debuginfo_failovermethod) +* [`epel_debuginfo_proxy`](#epel_debuginfo_proxy) +* [`epel_debuginfo_enabled`](#epel_debuginfo_enabled) +* [`epel_debuginfo_gpgcheck`](#epel_debuginfo_gpgcheck) +* [`epel_debuginfo_repo_gpgcheck`](#epel_debuginfo_repo_gpgcheck) +* [`epel_debuginfo_metalink`](#epel_debuginfo_metalink) +* [`epel_debuginfo_exclude`](#epel_debuginfo_exclude) +* [`epel_debuginfo_includepkgs`](#epel_debuginfo_includepkgs) +* [`epel_debuginfo_sslclientkey`](#epel_debuginfo_sslclientkey) +* [`epel_debuginfo_sslclientcert`](#epel_debuginfo_sslclientcert) +* [`epel_debuginfo_username`](#epel_debuginfo_username) +* [`epel_debuginfo_password`](#epel_debuginfo_password) +* [`epel_testing_source_mirrorlist`](#epel_testing_source_mirrorlist) +* [`epel_testing_source_baseurl`](#epel_testing_source_baseurl) +* [`epel_testing_source_failovermethod`](#epel_testing_source_failovermethod) +* [`epel_testing_source_proxy`](#epel_testing_source_proxy) +* [`epel_testing_source_enabled`](#epel_testing_source_enabled) +* [`epel_testing_source_gpgcheck`](#epel_testing_source_gpgcheck) +* [`epel_testing_source_repo_gpgcheck`](#epel_testing_source_repo_gpgcheck) +* [`epel_testing_source_metalink`](#epel_testing_source_metalink) +* [`epel_testing_source_exclude`](#epel_testing_source_exclude) +* [`epel_testing_source_includepkgs`](#epel_testing_source_includepkgs) +* [`epel_testing_source_sslclientkey`](#epel_testing_source_sslclientkey) +* [`epel_testing_source_sslclientcert`](#epel_testing_source_sslclientcert) +* [`epel_testing_source_username`](#epel_testing_source_username) +* [`epel_testing_source_password`](#epel_testing_source_password) +* [`epel_testing_debuginfo_mirrorlist`](#epel_testing_debuginfo_mirrorlist) +* [`epel_testing_debuginfo_baseurl`](#epel_testing_debuginfo_baseurl) +* [`epel_testing_debuginfo_failovermethod`](#epel_testing_debuginfo_failovermethod) +* [`epel_testing_debuginfo_proxy`](#epel_testing_debuginfo_proxy) +* [`epel_testing_debuginfo_enabled`](#epel_testing_debuginfo_enabled) +* [`epel_testing_debuginfo_gpgcheck`](#epel_testing_debuginfo_gpgcheck) +* [`epel_testing_debuginfo_repo_gpgcheck`](#epel_testing_debuginfo_repo_gpgcheck) +* [`epel_testing_debuginfo_metalink`](#epel_testing_debuginfo_metalink) +* [`epel_testing_debuginfo_exclude`](#epel_testing_debuginfo_exclude) +* [`epel_testing_debuginfo_includepkgs`](#epel_testing_debuginfo_includepkgs) +* [`epel_testing_debuginfo_sslclientkey`](#epel_testing_debuginfo_sslclientkey) +* [`epel_testing_debuginfo_sslclientcert`](#epel_testing_debuginfo_sslclientcert) +* [`epel_testing_debuginfo_username`](#epel_testing_debuginfo_username) +* [`epel_testing_debuginfo_password`](#epel_testing_debuginfo_password) +* [`os_maj_release`](#os_maj_release) + +##### `epel_managed` + +Data type: `Boolean` + +Determines if the main EPEL repository is managed. + +Default value: ``true`` + +##### `epel_source_managed` + +Data type: `Boolean` + +Determines if the `epel-source` repository is managed. + +Default value: ``true`` + +##### `epel_debuginfo_managed` + +Data type: `Boolean` + +Determines if the `epel-debuginfo` repository is managed. + +Default value: ``true`` + +##### `epel_testing_managed` + +Data type: `Boolean` + +Determines if the `epel-testing` repository is managed. + +Default value: ``true`` + +##### `epel_testing_source_managed` + +Data type: `Boolean` + +Determines if the `epel-testing-source` repository is managed. + +Default value: ``true`` + +##### `epel_testing_debuginfo_managed` + +Data type: `Boolean` + +Determines if the `epel-testing-debuginfo` repository is managed. + +Default value: ``true`` + +##### `epel_gpg_managed` + +Data type: `Boolean` + +Detemines if the module manages the rpm-gpg key for EPEL. + +Default value: ``true`` + +##### `epel_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_mirrorlist` + +##### `epel_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_baseurl` + +##### `epel_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_failovermethod` + +##### `epel_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_proxy` + +##### `epel_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_enabled` + +##### `epel_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_gpgcheck` + +##### `epel_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_repo_gpgcheck` + +##### `epel_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_metalink` + +##### `epel_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_mirrorlist` + +##### `epel_testing_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_baseurl` + +##### `epel_testing_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_failovermethod` + +##### `epel_testing_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_proxy` + +##### `epel_testing_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_enabled` + +##### `epel_testing_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_gpgcheck` + +##### `epel_testing_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_repo_gpgcheck` + +##### `epel_testing_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_metalink` + +##### `epel_testing_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_source_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_mirrorlist` + +##### `epel_source_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_baseurl` + +##### `epel_source_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_failovermethod` + +##### `epel_source_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_proxy` + +##### `epel_source_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_enabled` + +##### `epel_source_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_gpgcheck` + +##### `epel_source_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_repo_gpgcheck` + +##### `epel_source_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_source_metalink` + +##### `epel_source_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_source_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_source_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_source_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_source_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_source_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_debuginfo_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_mirrorlist` + +##### `epel_debuginfo_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_baseurl` + +##### `epel_debuginfo_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_failovermethod` + +##### `epel_debuginfo_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_proxy` + +##### `epel_debuginfo_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_enabled` + +##### `epel_debuginfo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_gpgcheck` + +##### `epel_debuginfo_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_repo_gpgcheck` + +##### `epel_debuginfo_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_debuginfo_metalink` + +##### `epel_debuginfo_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_debuginfo_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_debuginfo_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_debuginfo_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_debuginfo_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_debuginfo_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_source_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_mirrorlist` + +##### `epel_testing_source_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_baseurl` + +##### `epel_testing_source_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_failovermethod` + +##### `epel_testing_source_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_proxy` + +##### `epel_testing_source_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_enabled` + +##### `epel_testing_source_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_gpgcheck` + +##### `epel_testing_source_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_repo_gpgcheck` + +##### `epel_testing_source_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_source_metalink` + +##### `epel_testing_source_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_source_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_source_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_source_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_source_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_source_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_mirrorlist` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_mirrorlist` + +##### `epel_testing_debuginfo_baseurl` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_baseurl` + +##### `epel_testing_debuginfo_failovermethod` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_failovermethod` + +##### `epel_testing_debuginfo_proxy` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_proxy` + +##### `epel_testing_debuginfo_enabled` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_enabled` + +##### `epel_testing_debuginfo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_gpgcheck` + +##### `epel_testing_debuginfo_repo_gpgcheck` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_repo_gpgcheck` + +##### `epel_testing_debuginfo_metalink` + +Data type: `Any` + + + +Default value: `$epel::params::epel_testing_debuginfo_metalink` + +##### `epel_testing_debuginfo_exclude` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_includepkgs` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_sslclientkey` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_sslclientcert` + +Data type: `Any` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_username` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `epel_testing_debuginfo_password` + +Data type: `Optional[String[1]]` + + + +Default value: ``undef`` + +##### `os_maj_release` + +Data type: `Any` + + + +Default value: `$epel::params::os_maj_release` + +## Defined types + diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/Rakefile --- a/modules/epel/Rakefile Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -require 'rubygems' -require 'bundler/setup' - -require 'puppetlabs_spec_helper/rake_tasks' -require 'puppet/version' -require 'puppet/vendor/semantic/lib/semantic' unless Puppet.version.to_f < 3.6 -require 'puppet-lint/tasks/puppet-lint' -require 'puppet-syntax/tasks/puppet-syntax' -require 'metadata-json-lint/rake_task' -require 'rubocop/rake_task' - -# These gems aren't always present, for instance -# on Travis with --without development -begin - require 'puppet_blacksmith/rake_tasks' -rescue LoadError # rubocop:disable Lint/HandleExceptions -end - -RuboCop::RakeTask.new - -exclude_paths = [ - "bundle/**/*", - "pkg/**/*", - "vendor/**/*", - "spec/**/*", -] - -Rake::Task[:lint].clear - -PuppetLint.configuration.relative = true -PuppetLint.configuration.disable_140chars -PuppetLint.configuration.disable_class_inherits_from_params_class -PuppetLint.configuration.disable_class_parameter_defaults -PuppetLint.configuration.fail_on_warnings = true - -PuppetLint::RakeTask.new :lint do |config| - config.ignore_paths = exclude_paths -end - -PuppetSyntax.exclude_paths = exclude_paths - -desc "Run acceptance tests" -RSpec::Core::RakeTask.new(:acceptance) do |t| - t.pattern = 'spec/acceptance' -end - -desc "Populate CONTRIBUTORS file" -task :contributors do - system("git log --format='%aN' | sort -u > CONTRIBUTORS") -end - -desc "Run syntax, lint, and spec tests." -task :test => [ - :metadata_lint, - :syntax, - :lint, - :rubocop, - :spec, -] diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/checksums.json --- a/modules/epel/checksums.json Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "Gemfile": "a388e0846458416f29c9cf4baa8af320", - "Gemfile.lock": "f7d0d2b6884445fc464bc75edc9ecfc0", - "LICENSE": "94f0b1430ad7e59227ccabf8232f81d5", - "README.md": "bbbfd945b524fddda9a68ed454fa7d87", - "Rakefile": "bd4e18fc0f2c4bc40fd75df89e3e5010", - "manifests/init.pp": "e0862c055750eef06d1a26e784a51f4f", - "manifests/params.pp": "2211a7ff0df0c71b8adb56c0c4b597ac", - "manifests/rpm_gpg_key.pp": "802b10226193de2fb5d8b5aebbd5d436", - "metadata.json": "a5beca3bbcac9c1df5f0f26cf98a7624", - "spec/classes/epel_spec.rb": "53d44c8a9cdef0a2aa27263d05a6da6d", - "spec/classes/shared_base.rb": "6be197dff5bc65e4b3badb16879a96e2", - "spec/classes/shared_debuginfo.rb": "a80a6178b20f161e3906b683865aadec", - "spec/classes/shared_gpgkey.rb": "5bedd11ebe5a50db5d3060a38f71528d", - "spec/classes/shared_source.rb": "86737f027566b3371fc3919ff9d788c6", - "spec/classes/shared_testing.rb": "87e00209bd6c86deae2dc2c8be475977", - "spec/classes/shared_testing_debuginfo.rb": "fba1e80372166dc36f08ca3a962c2013", - "spec/classes/shared_testing_source.rb": "875b0c9994ed6609c5e1b2d09071ebd1", - "spec/defines/rpm_gpg_key_spec.rb": "172a1cb39a268c1aedf4f7093c29a37d", - "spec/spec_helper.rb": "4e5486b3c8569c11fcd2bbd9fa3cfa1b", - "spec/spec_helper_system.rb": "5cccf52dce8789724bc369c44d0ea41d", - "spec/system/basic_spec.rb": "0f463b3b7ddbdd3bd8197ee62af2511c", - "spec/system/usage_spec.rb": "f99923cea572719ff0af02ce82ac2610", - "templates/RPM-GPG-KEY-EPEL-5.erb": "0466c259781def56dafe0a2cdc9de0c5", - "templates/RPM-GPG-KEY-EPEL-6.erb": "d865e6b948a74cb03bc3401c0b01b785", - "templates/RPM-GPG-KEY-EPEL-7.erb": "58fa8ae27c89f37b08429f04fd4a88cc", - "tests/init.pp": "964d2df016bcb1c39760e8b32b6f1a0a" -} \ No newline at end of file diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/files/RPM-GPG-KEY-EPEL-6 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/files/RPM-GPG-KEY-EPEL-6 Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.5 (GNU/Linux) + +mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 +JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B +M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn +XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 +pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV +QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp +Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq +3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu +vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar +1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g +YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB +tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS +KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9 +qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT +9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP +Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS +WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft +HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF +p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP +x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8 +wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J +l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG +iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR +XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ== +=V/6I +-----END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/files/RPM-GPG-KEY-EPEL-7 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/files/RPM-GPG-KEY-EPEL-7 Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,29 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.11 (GNU/Linux) + +mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB +OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm +jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP +vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM +jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 +S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ +n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB +9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 +T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj +GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf +uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB +tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB +AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk +5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q +ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu +MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re +9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax +CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv +HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB +VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q +thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc +ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 +vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt +RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== +=hdPa +-----END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/files/RPM-GPG-KEY-EPEL-8 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/epel/files/RPM-GPG-KEY-EPEL-8 Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,28 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFz3zvsBEADJOIIWllGudxnpvJnkxQz2CtoWI7godVnoclrdl83kVjqSQp+2 +dgxuG5mUiADUfYHaRQzxKw8efuQnwxzU9kZ70ngCxtmbQWGmUmfSThiapOz00018 ++eo5MFabd2vdiGo1y+51m2sRDpN8qdCaqXko65cyMuLXrojJHIuvRA/x7iqOrRfy +a8x3OxC4PEgl5pgDnP8pVK0lLYncDEQCN76D9ubhZQWhISF/zJI+e806V71hzfyL +/Mt3mQm/li+lRKU25Usk9dWaf4NH/wZHMIPAkVJ4uD4H/uS49wqWnyiTYGT7hUbi +ecF7crhLCmlRzvJR8mkRP6/4T/F3tNDPWZeDNEDVFUkTFHNU6/h2+O398MNY/fOh +yKaNK3nnE0g6QJ1dOH31lXHARlpFOtWt3VmZU0JnWLeYdvap4Eff9qTWZJhI7Cq0 +Wm8DgLUpXgNlkmquvE7P2W5EAr2E5AqKQoDbfw/GiWdRvHWKeNGMRLnGI3QuoX3U +pAlXD7v13VdZxNydvpeypbf/AfRyrHRKhkUj3cU1pYkM3DNZE77C5JUe6/0nxbt4 +ETUZBTgLgYJGP8c7PbkVnO6I/KgL1jw+7MW6Az8Ox+RXZLyGMVmbW/TMc8haJfKL +MoUo3TVk8nPiUhoOC0/kI7j9ilFrBxBU5dUtF4ITAWc8xnG6jJs/IsvRpQARAQAB +tChGZWRvcmEgRVBFTCAoOCkgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB +AgAiBQJc9877AhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAh6kWrL4bW +oWagD/4xnLWws34GByVDQkjprk0fX7Iyhpm/U7BsIHKspHLL+Y46vAAGY/9vMvdE +0fcr9Ek2Zp7zE1RWmSCzzzUgTG6BFoTG1H4Fho/7Z8BXK/jybowXSZfqXnTOfhSF +alwDdwlSJvfYNV9MbyvbxN8qZRU1z7PEWZrIzFDDToFRk0R71zHpnPTNIJ5/YXTw +NqU9OxII8hMQj4ufF11040AJQZ7br3rzerlyBOB+Jd1zSPVrAPpeMyJppWFHSDAI +WK6x+am13VIInXtqB/Cz4GBHLFK5d2/IYspVw47Solj8jiFEtnAq6+1Aq5WH3iB4 +bE2e6z00DSF93frwOyWN7WmPIoc2QsNRJhgfJC+isGQAwwq8xAbHEBeuyMG8GZjz +xohg0H4bOSEujVLTjH1xbAG4DnhWO/1VXLX+LXELycO8ZQTcjj/4AQKuo4wvMPrv +9A169oETG+VwQlNd74VBPGCvhnzwGXNbTK/KH1+WRH0YSb+41flB3NKhMSU6dGI0 +SGtIxDSHhVVNmx2/6XiT9U/znrZsG5Kw8nIbbFz+9MGUUWgJMsd1Zl9R8gz7V9fp +n7L7y5LhJ8HOCMsY/Z7/7HUs+t/A1MI4g7Q5g5UuSZdgi0zxukiWuCkLeAiAP4y7 +zKK4OjJ644NDcWCHa36znwVmkz3ixL8Q0auR15Oqq2BjR/fyog== +=84m8 +-----END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/manifests/init.pp --- a/modules/epel/manifests/init.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/manifests/init.pp Mon Jan 03 17:13:06 2022 +0000 @@ -1,242 +1,313 @@ -# Class epel -# -# Actions: -# Configure the proper repositories and import GPG keys +# @summary Configure the proper EPEL repositories and import GPG keys # -# Requires: -# You should probably be on an Enterprise Linux variant. (Centos, RHEL, -# Scientific, Oracle, Ascendos, et al) +# @param epel_managed +# Determines if the main EPEL repository is managed. +# @param epel_source_managed +# Determines if the `epel-source` repository is managed. +# @param epel_debuginfo_managed +# Determines if the `epel-debuginfo` repository is managed. +# @param epel_testing_managed +# Determines if the `epel-testing` repository is managed. +# @param epel_testing_source_managed +# Determines if the `epel-testing-source` repository is managed. +# @param epel_testing_debuginfo_managed +# Determines if the `epel-testing-debuginfo` repository is managed. +# @param epel_gpg_managed +# Detemines if the module manages the rpm-gpg key for EPEL. # -# Sample Usage: -# include epel +# @example Basic Usage +# include epel # +# @see https://fedoraproject.org/wiki/EPEL class epel ( - $epel_mirrorlist = $epel::params::epel_mirrorlist, - $epel_baseurl = $epel::params::epel_baseurl, - $epel_failovermethod = $epel::params::epel_failovermethod, - $epel_proxy = $epel::params::epel_proxy, - $epel_enabled = $epel::params::epel_enabled, - $epel_gpgcheck = $epel::params::epel_gpgcheck, - $epel_managed = $epel::params::epel_managed, - $epel_exclude = undef, - $epel_includepkgs = undef, - $epel_sslclientkey = undef, - $epel_sslclientcert = undef, - $epel_testing_mirrorlist = $epel::params::epel_testing_mirrorlist, - $epel_testing_baseurl = $epel::params::epel_testing_baseurl, - $epel_testing_failovermethod = $epel::params::epel_testing_failovermethod, - $epel_testing_proxy = $epel::params::epel_testing_proxy, - $epel_testing_enabled = $epel::params::epel_testing_enabled, - $epel_testing_gpgcheck = $epel::params::epel_testing_gpgcheck, - $epel_testing_managed = $epel::params::epel_testing_managed, - $epel_testing_exclude = undef, - $epel_testing_includepkgs = undef, - $epel_testing_sslclientkey = undef, - $epel_testing_sslclientcert = undef, - $epel_source_mirrorlist = $epel::params::epel_source_mirrorlist, - $epel_source_baseurl = $epel::params::epel_source_baseurl, - $epel_source_failovermethod = $epel::params::epel_source_failovermethod, - $epel_source_proxy = $epel::params::epel_source_proxy, - $epel_source_enabled = $epel::params::epel_source_enabled, - $epel_source_gpgcheck = $epel::params::epel_source_gpgcheck, - $epel_source_managed = $epel::params::epel_source_managed, - $epel_source_exclude = undef, - $epel_source_includepkgs = undef, - $epel_source_sslclientkey = undef, - $epel_source_sslclientcert = undef, - $epel_debuginfo_mirrorlist = $epel::params::epel_debuginfo_mirrorlist, - $epel_debuginfo_baseurl = $epel::params::epel_debuginfo_baseurl, - $epel_debuginfo_failovermethod = $epel::params::epel_debuginfo_failovermethod, - $epel_debuginfo_proxy = $epel::params::epel_debuginfo_proxy, - $epel_debuginfo_enabled = $epel::params::epel_debuginfo_enabled, - $epel_debuginfo_gpgcheck = $epel::params::epel_debuginfo_gpgcheck, - $epel_debuginfo_managed = $epel::params::epel_debuginfo_managed, - $epel_debuginfo_exclude = undef, - $epel_debuginfo_includepkgs = undef, - $epel_debuginfo_sslclientkey = undef, - $epel_debuginfo_sslclientcert = undef, - $epel_testing_source_mirrorlist = $epel::params::epel_testing_source_mirrorlist, - $epel_testing_source_baseurl = $epel::params::epel_testing_source_baseurl, - $epel_testing_source_failovermethod = $epel::params::epel_testing_source_failovermethod, - $epel_testing_source_proxy = $epel::params::epel_testing_source_proxy, - $epel_testing_source_enabled = $epel::params::epel_testing_source_enabled, - $epel_testing_source_gpgcheck = $epel::params::epel_testing_source_gpgcheck, - $epel_testing_source_managed = $epel::params::epel_testing_source_managed, - $epel_testing_source_exclude = undef, - $epel_testing_source_includepkgs = undef, - $epel_testing_source_sslclientkey = undef, - $epel_testing_source_sslclientcert = undef, - $epel_testing_debuginfo_mirrorlist = $epel::params::epel_testing_debuginfo_mirrorlist, - $epel_testing_debuginfo_baseurl = $epel::params::epel_testing_debuginfo_baseurl, - $epel_testing_debuginfo_failovermethod = $epel::params::epel_testing_debuginfo_failovermethod, - $epel_testing_debuginfo_proxy = $epel::params::epel_testing_debuginfo_proxy, - $epel_testing_debuginfo_enabled = $epel::params::epel_testing_debuginfo_enabled, - $epel_testing_debuginfo_gpgcheck = $epel::params::epel_testing_debuginfo_gpgcheck, - $epel_testing_debuginfo_managed = $epel::params::epel_testing_debuginfo_managed, - $epel_testing_debuginfo_exclude = undef, - $epel_testing_debuginfo_includepkgs = undef, - $epel_testing_debuginfo_sslclientkey = undef, - $epel_testing_debuginfo_sslclientcert = undef, - $epel_gpg_managed = $epel::params::epel_gpg_managed, - $os_maj_release = $epel::params::os_maj_release, + $epel_mirrorlist = $epel::params::epel_mirrorlist, + $epel_baseurl = $epel::params::epel_baseurl, + $epel_failovermethod = $epel::params::epel_failovermethod, + $epel_proxy = $epel::params::epel_proxy, + $epel_enabled = $epel::params::epel_enabled, + $epel_gpgcheck = $epel::params::epel_gpgcheck, + $epel_repo_gpgcheck = $epel::params::epel_repo_gpgcheck, + $epel_metalink = $epel::params::epel_metalink, + Boolean $epel_managed = true, + $epel_exclude = undef, + $epel_includepkgs = undef, + $epel_sslclientkey = undef, + $epel_sslclientcert = undef, + Optional[String[1]] $epel_username = undef, + Optional[String[1]] $epel_password = undef, + $epel_testing_mirrorlist = $epel::params::epel_testing_mirrorlist, + $epel_testing_baseurl = $epel::params::epel_testing_baseurl, + $epel_testing_failovermethod = $epel::params::epel_testing_failovermethod, + $epel_testing_proxy = $epel::params::epel_testing_proxy, + $epel_testing_enabled = $epel::params::epel_testing_enabled, + $epel_testing_gpgcheck = $epel::params::epel_testing_gpgcheck, + $epel_testing_repo_gpgcheck = $epel::params::epel_testing_repo_gpgcheck, + $epel_testing_metalink = $epel::params::epel_testing_metalink, + Boolean $epel_testing_managed = true, + $epel_testing_exclude = undef, + $epel_testing_includepkgs = undef, + $epel_testing_sslclientkey = undef, + $epel_testing_sslclientcert = undef, + Optional[String[1]] $epel_testing_username = undef, + Optional[String[1]] $epel_testing_password = undef, + $epel_source_mirrorlist = $epel::params::epel_source_mirrorlist, + $epel_source_baseurl = $epel::params::epel_source_baseurl, + $epel_source_failovermethod = $epel::params::epel_source_failovermethod, + $epel_source_proxy = $epel::params::epel_source_proxy, + $epel_source_enabled = $epel::params::epel_source_enabled, + $epel_source_gpgcheck = $epel::params::epel_source_gpgcheck, + $epel_source_repo_gpgcheck = $epel::params::epel_source_repo_gpgcheck, + $epel_source_metalink = $epel::params::epel_source_metalink, + Boolean $epel_source_managed = true, + $epel_source_exclude = undef, + $epel_source_includepkgs = undef, + $epel_source_sslclientkey = undef, + $epel_source_sslclientcert = undef, + Optional[String[1]] $epel_source_username = undef, + Optional[String[1]] $epel_source_password = undef, + $epel_debuginfo_mirrorlist = $epel::params::epel_debuginfo_mirrorlist, + $epel_debuginfo_baseurl = $epel::params::epel_debuginfo_baseurl, + $epel_debuginfo_failovermethod = $epel::params::epel_debuginfo_failovermethod, + $epel_debuginfo_proxy = $epel::params::epel_debuginfo_proxy, + $epel_debuginfo_enabled = $epel::params::epel_debuginfo_enabled, + $epel_debuginfo_gpgcheck = $epel::params::epel_debuginfo_gpgcheck, + $epel_debuginfo_repo_gpgcheck = $epel::params::epel_debuginfo_repo_gpgcheck, + $epel_debuginfo_metalink = $epel::params::epel_debuginfo_metalink, + Boolean $epel_debuginfo_managed = true, + $epel_debuginfo_exclude = undef, + $epel_debuginfo_includepkgs = undef, + $epel_debuginfo_sslclientkey = undef, + $epel_debuginfo_sslclientcert = undef, + Optional[String[1]] $epel_debuginfo_username = undef, + Optional[String[1]] $epel_debuginfo_password = undef, + $epel_testing_source_mirrorlist = $epel::params::epel_testing_source_mirrorlist, + $epel_testing_source_baseurl = $epel::params::epel_testing_source_baseurl, + $epel_testing_source_failovermethod = $epel::params::epel_testing_source_failovermethod, + $epel_testing_source_proxy = $epel::params::epel_testing_source_proxy, + $epel_testing_source_enabled = $epel::params::epel_testing_source_enabled, + $epel_testing_source_gpgcheck = $epel::params::epel_testing_source_gpgcheck, + $epel_testing_source_repo_gpgcheck = $epel::params::epel_testing_source_repo_gpgcheck, + $epel_testing_source_metalink = $epel::params::epel_testing_source_metalink, + Boolean $epel_testing_source_managed = true, + $epel_testing_source_exclude = undef, + $epel_testing_source_includepkgs = undef, + $epel_testing_source_sslclientkey = undef, + $epel_testing_source_sslclientcert = undef, + Optional[String[1]] $epel_testing_source_username = undef, + Optional[String[1]] $epel_testing_source_password = undef, + $epel_testing_debuginfo_mirrorlist = $epel::params::epel_testing_debuginfo_mirrorlist, + $epel_testing_debuginfo_baseurl = $epel::params::epel_testing_debuginfo_baseurl, + $epel_testing_debuginfo_failovermethod = $epel::params::epel_testing_debuginfo_failovermethod, + $epel_testing_debuginfo_proxy = $epel::params::epel_testing_debuginfo_proxy, + $epel_testing_debuginfo_enabled = $epel::params::epel_testing_debuginfo_enabled, + $epel_testing_debuginfo_gpgcheck = $epel::params::epel_testing_debuginfo_gpgcheck, + $epel_testing_debuginfo_repo_gpgcheck = $epel::params::epel_testing_debuginfo_repo_gpgcheck, + $epel_testing_debuginfo_metalink = $epel::params::epel_testing_debuginfo_metalink, + Boolean $epel_testing_debuginfo_managed = true, + $epel_testing_debuginfo_exclude = undef, + $epel_testing_debuginfo_includepkgs = undef, + $epel_testing_debuginfo_sslclientkey = undef, + $epel_testing_debuginfo_sslclientcert = undef, + Optional[String[1]] $epel_testing_debuginfo_username = undef, + Optional[String[1]] $epel_testing_debuginfo_password = undef, + Boolean $epel_gpg_managed = true, + $os_maj_release = $epel::params::os_maj_release, ) inherits epel::params { - if "${::osfamily}" == 'RedHat' and "${::operatingsystem}" !~ /Fedora|Amazon/ { # lint:ignore:only_variable_string - if $epel_testing_managed { - yumrepo { 'epel-testing': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_testing_baseurl ? { - 'absent' => $epel_testing_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_testing_baseurl, - failovermethod => $epel_testing_failovermethod, - proxy => $epel_testing_proxy, - enabled => $epel_testing_enabled, - gpgcheck => $epel_testing_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch", - exclude => $epel_testing_exclude, - includepkgs => $epel_testing_includepkgs, - sslclientkey => $epel_testing_sslclientkey, - sslclientcert => $epel_testing_sslclientcert, - } - } + if $facts['os']['family'] == 'RedHat' and $facts['os']['name'] != 'Fedora' { + if $epel_testing_managed { + yumrepo { 'epel-testing': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_testing_baseurl ? { + 'absent' => $epel_testing_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_testing_baseurl, + failovermethod => $epel_testing_failovermethod, + proxy => $epel_testing_proxy, + enabled => $epel_testing_enabled, + gpgcheck => $epel_testing_gpgcheck, + repo_gpgcheck => $epel_testing_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + metalink => $epel_testing_metalink, + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch", + exclude => $epel_testing_exclude, + includepkgs => $epel_testing_includepkgs, + sslclientkey => $epel_testing_sslclientkey, + sslclientcert => $epel_testing_sslclientcert, + username => $epel_testing_username, + password => $epel_testing_password, + } - if $epel_testing_debuginfo_managed { - yumrepo { 'epel-testing-debuginfo': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_testing_debuginfo_baseurl ? { - 'absent' => $epel_testing_debuginfo_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_testing_debuginfo_baseurl, - failovermethod => $epel_testing_debuginfo_failovermethod, - proxy => $epel_testing_debuginfo_proxy, - enabled => $epel_testing_debuginfo_enabled, - gpgcheck => $epel_testing_debuginfo_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Debug", - exclude => $epel_testing_debuginfo_exclude, - includepkgs => $epel_testing_debuginfo_includepkgs, - sslclientkey => $epel_testing_debuginfo_sslclientkey, - sslclientcert => $epel_testing_debuginfo_sslclientcert, - } - } - - if $epel_testing_source_managed { - yumrepo { 'epel-testing-source': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_testing_source_baseurl ? { - 'absent' => $epel_testing_source_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_testing_source_baseurl, - failovermethod => $epel_testing_source_failovermethod, - proxy => $epel_testing_source_proxy, - enabled => $epel_testing_source_enabled, - gpgcheck => $epel_testing_source_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Source", - exclude => $epel_testing_source_exclude, - includepkgs => $epel_testing_source_includepkgs, - sslclientkey => $epel_testing_source_sslclientkey, - sslclientcert => $epel_testing_source_sslclientcert, - } - } - - if $epel_managed { - yumrepo { 'epel': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_baseurl ? { - 'absent' => $epel_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_baseurl, - failovermethod => $epel_failovermethod, - proxy => $epel_proxy, - enabled => $epel_enabled, - gpgcheck => $epel_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch", - exclude => $epel_exclude, - includepkgs => $epel_includepkgs, - sslclientkey => $epel_sslclientkey, - sslclientcert => $epel_sslclientcert, - } - } - - if $epel_debuginfo_managed { - yumrepo { 'epel-debuginfo': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_debuginfo_baseurl ? { - 'absent' => $epel_debuginfo_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_debuginfo_baseurl, - failovermethod => $epel_debuginfo_failovermethod, - proxy => $epel_debuginfo_proxy, - enabled => $epel_debuginfo_enabled, - gpgcheck => $epel_debuginfo_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Debug", - exclude => $epel_debuginfo_exclude, - includepkgs => $epel_debuginfo_includepkgs, - sslclientkey => $epel_debuginfo_sslclientkey, - sslclientcert => $epel_debuginfo_sslclientcert, - } - } - - if $epel_source_managed { - yumrepo { 'epel-source': - # lint:ignore:selector_inside_resource - mirrorlist => $epel_source_baseurl ? { - 'absent' => $epel_source_mirrorlist, - default => 'absent', - }, - # lint:endignore - baseurl => $epel_source_baseurl, - failovermethod => $epel_source_failovermethod, - proxy => $epel_source_proxy, - enabled => $epel_source_enabled, - gpgcheck => $epel_source_gpgcheck, - gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", - descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Source", - exclude => $epel_source_exclude, - includepkgs => $epel_source_includepkgs, - sslclientkey => $epel_source_sslclientkey, - sslclientcert => $epel_source_sslclientcert, - } - } - - # ERB template used here to ensure file content is in the Puppet catalog; - # nothing is interpolated in these templates. - if $epel_gpg_managed { - file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}": - ensure => present, - owner => 'root', - group => 'root', - mode => '0644', - content => template("epel/RPM-GPG-KEY-EPEL-${os_maj_release}.erb"), + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing'] + } } - epel::rpm_gpg_key{ "EPEL-${os_maj_release}": - path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + if $epel_testing_debuginfo_managed { + yumrepo { 'epel-testing-debuginfo': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_testing_debuginfo_baseurl ? { + 'absent' => $epel_testing_debuginfo_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_testing_debuginfo_baseurl, + failovermethod => $epel_testing_debuginfo_failovermethod, + proxy => $epel_testing_debuginfo_proxy, + enabled => $epel_testing_debuginfo_enabled, + gpgcheck => $epel_testing_debuginfo_gpgcheck, + repo_gpgcheck => $epel_testing_debuginfo_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + metalink => $epel_testing_debuginfo_metalink, + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Debug", + exclude => $epel_testing_debuginfo_exclude, + includepkgs => $epel_testing_debuginfo_includepkgs, + sslclientkey => $epel_testing_debuginfo_sslclientkey, + sslclientcert => $epel_testing_debuginfo_sslclientcert, + username => $epel_testing_debuginfo_username, + password => $epel_testing_debuginfo_password, + } + + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing-debuginfo'] + } } - } + + if $epel_testing_source_managed { + yumrepo { 'epel-testing-source': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_testing_source_baseurl ? { + 'absent' => $epel_testing_source_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_testing_source_baseurl, + failovermethod => $epel_testing_source_failovermethod, + proxy => $epel_testing_source_proxy, + enabled => $epel_testing_source_enabled, + gpgcheck => $epel_testing_source_gpgcheck, + repo_gpgcheck => $epel_testing_source_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + metalink => $epel_testing_source_metalink, + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - Testing - \$basearch - Source", + exclude => $epel_testing_source_exclude, + includepkgs => $epel_testing_source_includepkgs, + sslclientkey => $epel_testing_source_sslclientkey, + sslclientcert => $epel_testing_source_sslclientcert, + username => $epel_testing_source_username, + password => $epel_testing_source_password, + } + + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-testing-source'] + } + } - } elsif "${::osfamily}" == 'RedHat' and "${::operatingsystem}" == 'Amazon' { # lint:ignore:only_variable_string - if $epel_managed { - yumrepo { 'epel': - enabled => $epel_enabled, - gpgcheck => $epel_gpgcheck, + if $epel_managed { + yumrepo { 'epel': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_baseurl ? { + 'absent' => $epel_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_baseurl, + failovermethod => $epel_failovermethod, + proxy => $epel_proxy, + enabled => $epel_enabled, + gpgcheck => $epel_gpgcheck, + repo_gpgcheck => $epel_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + metalink => $epel_metalink, + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch", + exclude => $epel_exclude, + includepkgs => $epel_includepkgs, + sslclientkey => $epel_sslclientkey, + sslclientcert => $epel_sslclientcert, + username => $epel_username, + password => $epel_password, + } + + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel'] + } } - } + + if $epel_debuginfo_managed { + yumrepo { 'epel-debuginfo': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_debuginfo_baseurl ? { + 'absent' => $epel_debuginfo_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_debuginfo_baseurl, + failovermethod => $epel_debuginfo_failovermethod, + proxy => $epel_debuginfo_proxy, + enabled => $epel_debuginfo_enabled, + gpgcheck => $epel_debuginfo_gpgcheck, + repo_gpgcheck => $epel_debuginfo_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Debug", + metalink => $epel_debuginfo_metalink, + exclude => $epel_debuginfo_exclude, + includepkgs => $epel_debuginfo_includepkgs, + sslclientkey => $epel_debuginfo_sslclientkey, + sslclientcert => $epel_debuginfo_sslclientcert, + username => $epel_debuginfo_username, + password => $epel_debuginfo_password, + } + + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-debuginfo'] + } + } + + if $epel_source_managed { + yumrepo { 'epel-source': + # lint:ignore:selector_inside_resource + mirrorlist => $epel_source_baseurl ? { + 'absent' => $epel_source_mirrorlist, + default => 'absent', + }, + # lint:endignore + baseurl => $epel_source_baseurl, + failovermethod => $epel_source_failovermethod, + proxy => $epel_source_proxy, + enabled => $epel_source_enabled, + gpgcheck => $epel_source_gpgcheck, + repo_gpgcheck => $epel_source_repo_gpgcheck, + gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + descr => "Extra Packages for Enterprise Linux ${os_maj_release} - \$basearch - Source", + metalink => $epel_source_metalink, + exclude => $epel_source_exclude, + includepkgs => $epel_source_includepkgs, + sslclientkey => $epel_source_sslclientkey, + sslclientcert => $epel_source_sslclientcert, + username => $epel_source_username, + password => $epel_source_password, + } + + if $epel_gpg_managed { + Epel::Rpm_gpg_key["EPEL-${os_maj_release}"] -> Yumrepo['epel-source'] + } + } + + if $epel_gpg_managed { + file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}": + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + content => file("epel/RPM-GPG-KEY-EPEL-${os_maj_release}"), + } + + epel::rpm_gpg_key { "EPEL-${os_maj_release}": + path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-${os_maj_release}", + } + } } else { - notice ("Your operating system ${::operatingsystem} will not have the EPEL repository applied") + notice ("Your operating system ${facts['os']['name']} will not have the EPEL repository applied") } } diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/manifests/params.pp --- a/modules/epel/manifests/params.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/manifests/params.pp Mon Jan 03 17:13:06 2022 +0000 @@ -1,4 +1,4 @@ -# Optional parameters in setting up EPEL +# @api private class epel::params { # Setting to 'absent' will fall back to the yum.conf # Setting proxy here will be the default for all repos. @@ -8,60 +8,63 @@ # the most specific declaration of proxy. $proxy = 'absent' - if getvar('::operatingsystemmajrelease') { - $os_maj_release = $::operatingsystemmajrelease + if $facts['os']['name'] == 'Amazon' and $facts['os']['release']['major'] == '2' { + # Amazon Linux 2 is equivalent of Enterprise Linux 7 so we use that version for epel + # https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/ + $os_maj_release = '7' + } elsif $facts['os']['name'] == 'Amazon' and $facts['os']['release']['major'] in ['2016','2018'] { + # Older versions are based on EL6 + $os_maj_release = '6' } else { - $os_versions = split("${::operatingsystemrelease}", '[.]') # lint:ignore:only_variable_string - $os_maj_release = $os_versions[0] + $os_maj_release = $facts['os']['release']['major'] } - if versioncmp($os_maj_release, '5') > 0 { - $url_path = 'metalink' - } else { - $url_path = 'mirrorlist' - } - - $epel_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=epel-${os_maj_release}&arch=\$basearch" + $epel_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=epel-${os_maj_release}&arch=\$basearch" $epel_baseurl = 'absent' $epel_failovermethod = 'priority' $epel_proxy = $proxy $epel_enabled = '1' $epel_gpgcheck = '1' - $epel_testing_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=testing-epel${os_maj_release}&arch=\$basearch" + $epel_repo_gpgcheck = '0' + $epel_metalink = "https://mirrors.fedoraproject.org/metalink?repo=epel-${os_maj_release}&arch=\$basearch" + $epel_testing_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=testing-epel${os_maj_release}&arch=\$basearch" $epel_testing_baseurl = 'absent' - $epel_managed = true $epel_testing_failovermethod = 'priority' $epel_testing_proxy = $proxy $epel_testing_enabled = '0' $epel_testing_gpgcheck = '1' - $epel_source_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=epel-source-${os_maj_release}&arch=\$basearch" - $epel_testing_managed = true + $epel_testing_repo_gpgcheck = '0' + $epel_testing_metalink = "https://mirrors.fedoraproject.org/metalink?repo=testing-epel${os_maj_release}&arch=\$basearch" + $epel_source_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=epel-source-${os_maj_release}&arch=\$basearch" $epel_source_baseurl = 'absent' $epel_source_failovermethod = 'priority' $epel_source_proxy = $proxy $epel_source_enabled = '0' $epel_source_gpgcheck = '1' - $epel_debuginfo_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=epel-debug-${os_maj_release}&arch=\$basearch" - $epel_source_managed = true + $epel_source_repo_gpgcheck = '0' + $epel_source_metalink = "https://mirrors.fedoraproject.org/metalink?repo=epel-source-${os_maj_release}&arch=\$basearch" + $epel_debuginfo_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=epel-debug-${os_maj_release}&arch=\$basearch" $epel_debuginfo_baseurl = 'absent' $epel_debuginfo_failovermethod = 'priority' $epel_debuginfo_proxy = $proxy $epel_debuginfo_enabled = '0' $epel_debuginfo_gpgcheck = '1' - $epel_testing_source_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=testing-source-epel${os_maj_release}&arch=\$basearch" + $epel_debuginfo_repo_gpgcheck = '0' + $epel_debuginfo_metalink = "https://mirrors.fedoraproject.org/metalink?repo=epel-debug-${os_maj_release}&arch=\$basearch" + $epel_testing_source_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel${os_maj_release}&arch=\$basearch" $epel_testing_source_baseurl = 'absent' - $epel_debuginfo_managed = true $epel_testing_source_failovermethod = 'priority' $epel_testing_source_proxy = $proxy $epel_testing_source_enabled = '0' $epel_testing_source_gpgcheck = '1' - $epel_testing_debuginfo_mirrorlist = "https://mirrors.fedoraproject.org/${url_path}?repo=testing-debug-epel${os_maj_release}&arch=\$basearch" + $epel_testing_source_repo_gpgcheck = '0' + $epel_testing_source_metalink = "https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel${os_maj_release}&arch=\$basearch" + $epel_testing_debuginfo_mirrorlist = "https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel${os_maj_release}&arch=\$basearch" $epel_testing_debuginfo_baseurl = 'absent' - $epel_testing_source_managed = true $epel_testing_debuginfo_failovermethod = 'priority' $epel_testing_debuginfo_proxy = $proxy $epel_testing_debuginfo_enabled = '0' $epel_testing_debuginfo_gpgcheck = '1' - $epel_testing_debuginfo_managed = true - $epel_gpg_managed = true + $epel_testing_debuginfo_repo_gpgcheck = '0' + $epel_testing_debuginfo_metalink = "https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel${os_maj_release}&arch=\$basearch" } diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/manifests/rpm_gpg_key.pp --- a/modules/epel/manifests/rpm_gpg_key.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/manifests/rpm_gpg_key.pp Mon Jan 03 17:13:06 2022 +0000 @@ -1,27 +1,20 @@ -# Define epel::rpm_gpg_key +# @summary Import an RPM gpg key # -# Actions: -# Import a RPM gpg key +# @api private # -# Parameters: -# -# [*path*] +# @param path # Path of the RPM GPG key to import # -# Reqiures: -# You should probably be on an Enterprise Linux variant. (Centos, RHEL, Scientific, Oracle, Ascendos, et al) -# -# Sample Usage: -# epel::rpm_gpg_key{ "EPEL-6": -# path => "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6" -# } -# -define epel::rpm_gpg_key($path) { +# @example Sample Usage +# epel::rpm_gpg_key{ 'EPEL-6': +# path => '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', +# } +define epel::rpm_gpg_key ($path) { # Given the path to a key, see if it is imported, if not, import it - exec { "import-${name}": + exec { "import-${name}": path => '/bin:/usr/bin:/sbin:/usr/sbin', command => "rpm --import ${path}", - unless => "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids --keyid-format short < ${path}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", + unless => "rpm -q gpg-pubkey-$(echo $(gpg -q --batch --with-colons --throw-keyids --keyid-format short < ${path}) | grep pub | cut -d ':' -f 5 | cut --characters=9- | tr '[A-Z]' '[a-z]')", require => File[$path], logoutput => 'on_failure', } diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/metadata.json --- a/modules/epel/metadata.json Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/epel/metadata.json Mon Jan 03 17:13:06 2022 +0000 @@ -1,66 +1,49 @@ { - "name": "stahnma-epel", - "version": "1.3.1", - "author": "stahnma", + "name": "puppet-epel", + "version": "3.1.0", + "author": "Vox Pupuli", "summary": "Setup the EPEL package repo", "license": "Apache-2.0", - "source": "https://github.com/stahnma/puppet-module-epel", - "project_page": "https://github.com/stahnma/puppet-module-epel", - "issues_url": "https://github.com/stahnma/puppet-module-epel/issues", - "dependencies": [ - { - "name": "puppetlabs/stdlib", - "version_requirement": ">= 3.0.0" - } - ], - "data_provider": null, + "source": "https://github.com/voxpupuli/puppet-epel", + "project_page": "https://github.com/voxpupuli/puppet-epel", + "issues_url": "https://github.com/voxpupuli/puppet-epel/issues", "operatingsystem_support": [ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "5", - "6", - "7" + "7", + "8" ] }, { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "5", - "6", - "7" + "7", + "8" ] }, { "operatingsystem": "Scientific", "operatingsystemrelease": [ - "5", - "6", - "7" - ] - }, - { - "operatingsystem": "OEL", - "operatingsystemrelease": [ - "5", - "6", "7" ] }, { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "5", - "6", - "7" + "7", + "8" ] } ], "requirements": [ { "name": "puppet", - "version_requirement": ">= 3.0.0" + "version_requirement": ">= 5.5.8 < 8.0.0" } ], - "description": "Setup the EPEL package repo on Centos/RHEL et al" + "description": "Setup the EPEL package repo on Centos/RHEL et al", + "dependencies": [ + + ] } diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/epel_spec.rb --- a/modules/epel/spec/classes/epel_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -require 'spec_helper' -require 'classes/shared_gpgkey' -require 'classes/shared_base' -require 'classes/shared_source' -require 'classes/shared_debuginfo' -require 'classes/shared_testing' -require 'classes/shared_testing_source' -require 'classes/shared_testing_debuginfo' - -describe 'epel' do - let :facts do - default_facts.merge( - operatingsystemrelease: '7.2.1511', - operatingsystemmajrelease: '7' - ) - end - - it { is_expected.to create_class('epel') } - it { is_expected.to contain_class('epel::params') } - - context "operatingsystem => #{default_facts[:operatingsystem]}" do - context 'operatingsystemmajrelease => 7' do - let :facts do - default_facts.merge( - operatingsystemrelease: '7.0.1406', - operatingsystemmajrelease: '7' - ) - end - - it_behaves_like :base_7 - it_behaves_like :gpgkey_7 - it_behaves_like :epel_source_7 - it_behaves_like :epel_debuginfo_7 - it_behaves_like :epel_testing_7 - it_behaves_like :epel_testing_source_7 - it_behaves_like :epel_testing_debuginfo_7 - - context 'epel_baseurl => https://example.com/epel/7/x87_74' do - let(:params) do - { - epel_baseurl: 'https://example.com/epel/7/x87_74' - } - end - - it { is_expected.to contain_yumrepo('epel').with(baseurl: 'https://example.com/epel/7/x87_74') } - it { is_expected.to contain_yumrepo('epel').with(mirrorlist: 'absent') } - end - - context 'epel_mirrorlist => absent' do - let(:params) do - { - epel_mirrorlist: 'absent' - } - end - - it { is_expected.to contain_yumrepo('epel').with(mirrorlist: 'absent') } - end - - context 'operatingsystemmajrelease undef' do - let :facts do - default_facts.merge( - operatingsystemrelease: '7.0.1406' - ) - end - - it_behaves_like :base_7 - it_behaves_like :gpgkey_7 - it_behaves_like :epel_source_7 - it_behaves_like :epel_debuginfo_7 - it_behaves_like :epel_testing_7 - it_behaves_like :epel_testing_source_7 - it_behaves_like :epel_testing_debuginfo_7 - end - end - - context 'operatingsystemmajrelease => 6' do - let :facts do - default_facts.merge( - operatingsystemrelease: '6.4', - operatingsystemmajrelease: '6' - ) - end - - it_behaves_like :base_6 - it_behaves_like :gpgkey_6 - it_behaves_like :epel_source_6 - it_behaves_like :epel_debuginfo_6 - it_behaves_like :epel_testing_6 - it_behaves_like :epel_testing_source_6 - it_behaves_like :epel_testing_debuginfo_6 - - context 'epel_baseurl => https://example.com/epel/6/x86_64' do - let(:params) do - { - epel_baseurl: 'https://example.com/epel/6/x86_64' - } - end - - it { is_expected.to contain_yumrepo('epel').with(baseurl: 'https://example.com/epel/6/x86_64') } - it { is_expected.to contain_yumrepo('epel').with(mirrorlist: 'absent') } - end - - context 'epel_mirrorlist => absent' do - let(:params) do - { - epel_mirrorlist: 'absent' - } - end - - it { is_expected.to contain_yumrepo('epel').with(mirrorlist: 'absent') } - end - - context 'operatingsystemmajrelease undef' do - let :facts do - default_facts.merge( - operatingsystemrelease: '6.4' - ) - end - - it_behaves_like :base_6 - it_behaves_like :gpgkey_6 - it_behaves_like :epel_source_6 - it_behaves_like :epel_debuginfo_6 - it_behaves_like :epel_testing_6 - it_behaves_like :epel_testing_source_6 - it_behaves_like :epel_testing_debuginfo_6 - end - end - - context 'operatingsystemmajrelease => 5' do - let :facts do - default_facts.merge( - operatingsystemrelease: '5.9', - operatingsystemmajrelease: '5' - ) - end - - it_behaves_like :base_5 - it_behaves_like :gpgkey_5 - it_behaves_like :epel_source_5 - it_behaves_like :epel_debuginfo_5 - it_behaves_like :epel_testing_5 - it_behaves_like :epel_testing_source_5 - it_behaves_like :epel_testing_debuginfo_5 - end - end - - context 'operatingsystem => Amazon' do - let :facts do - default_facts.merge( - operatingsystem: 'Amazon', - operatingsystemrelease: 'Amazon' - ) - end - - it { is_expected.not_to contain_yumrepo('epel-testing') } - it { is_expected.not_to contain_yumrepo('epel-testing-debuginfo') } - it { is_expected.not_to contain_yumrepo('epel-testing-source') } - it { is_expected.not_to contain_yumrepo('epel-debuginfo') } - it { is_expected.not_to contain_yumrepo('epel-source') } - - it do - is_expected.to contain_yumrepo('epel').with( - enabled: '1', - gpgcheck: '1' - ) - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_base.rb --- a/modules/epel/spec/classes/shared_base.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :base do - it do - is_expected.to contain_yumrepo('epel').with( - failovermethod: 'priority', - proxy: 'absent', - enabled: '1', - gpgcheck: '1' - ) - end -end - -shared_examples_for :base_7 do - include_context :base - - it do - is_expected.to contain_yumrepo('epel').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - $basearch' - ) - end -end - -shared_examples_for :base_6 do - include_context :base - - it do - is_expected.to contain_yumrepo('epel').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - $basearch' - ) - end -end - -shared_examples_for :base_5 do - include_context :base - - it do - is_expected.to contain_yumrepo('epel').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - $basearch' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_debuginfo.rb --- a/modules/epel/spec/classes/shared_debuginfo.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :epel_debuginfo do - it do - is_expected.to contain_yumrepo('epel-debuginfo').with( - proxy: 'absent', - failovermethod: 'priority', - enabled: '0', - gpgcheck: '1' - ) - end -end - -shared_examples_for :epel_debuginfo_7 do - include_context :epel_debuginfo - - it do - is_expected.to contain_yumrepo('epel-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - $basearch - Debug' - ) - end -end - -shared_examples_for :epel_debuginfo_6 do - include_context :epel_debuginfo - - it do - is_expected.to contain_yumrepo('epel-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - $basearch - Debug' - ) - end -end - -shared_examples_for :epel_debuginfo_5 do - include_context :epel_debuginfo - - it do - is_expected.to contain_yumrepo('epel-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=epel-debug-5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - $basearch - Debug' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_gpgkey.rb --- a/modules/epel/spec/classes/shared_gpgkey.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -require 'spec_helper' - -shared_examples_for :gpgkey_7 do - it do - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7').with( - ensure: 'present', - owner: 'root', - group: 'root', - mode: '0644' - ) - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7'). - with_content(%r{BEGIN PGP PUBLIC KEY BLOCK}) - end - - it do - is_expected.to contain_epel__rpm_gpg_key('EPEL-7').with( - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7' - ) - end -end - -shared_examples_for :gpgkey_6 do - it do - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6').with( - ensure: 'present', - owner: 'root', - group: 'root', - mode: '0644' - ) - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6'). - with_content(%r{BEGIN PGP PUBLIC KEY BLOCK}) - end - - it do - is_expected.to contain_epel__rpm_gpg_key('EPEL-6').with( - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6' - ) - end -end - -shared_examples_for :gpgkey_5 do - it do - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5').with( - ensure: 'present', - owner: 'root', - group: 'root', - mode: '0644' - ) - is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5'). - with_content(%r{BEGIN PGP PUBLIC KEY BLOCK}) - end - - it do - is_expected.to contain_epel__rpm_gpg_key('EPEL-5').with( - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_source.rb --- a/modules/epel/spec/classes/shared_source.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :epel_source do - it do - is_expected.to contain_yumrepo('epel-source').with( - proxy: 'absent', - failovermethod: 'priority', - enabled: '0', - gpgcheck: '1' - ) - end -end - -shared_examples_for :epel_source_7 do - include_context :epel_source - - it do - is_expected.to contain_yumrepo('epel-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - $basearch - Source' - ) - end -end - -shared_examples_for :epel_source_6 do - include_context :epel_source - - it do - is_expected.to contain_yumrepo('epel-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - $basearch - Source' - ) - end -end - -shared_examples_for :epel_source_5 do - include_context :epel_source - - it do - is_expected.to contain_yumrepo('epel-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=epel-source-5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - $basearch - Source' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_testing.rb --- a/modules/epel/spec/classes/shared_testing.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :epel_testing do - it do - is_expected.to contain_yumrepo('epel-testing').with( - failovermethod: 'priority', - proxy: 'absent', - enabled: '0', - gpgcheck: '1' - ) - end -end - -shared_examples_for :epel_testing_7 do - include_context :epel_testing - - it do - is_expected.to contain_yumrepo('epel-testing').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - Testing - $basearch' - ) - end -end - -shared_examples_for :epel_testing_6 do - include_context :epel_testing - - it do - is_expected.to contain_yumrepo('epel-testing').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - Testing - $basearch' - ) - end -end - -shared_examples_for :epel_testing_5 do - include_context :epel_testing - - it do - is_expected.to contain_yumrepo('epel-testing').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=testing-epel5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - Testing - $basearch' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_testing_debuginfo.rb --- a/modules/epel/spec/classes/shared_testing_debuginfo.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :epel_testing_debuginfo do - it do - is_expected.to contain_yumrepo('epel-testing-debuginfo').with( - failovermethod: 'priority', - proxy: 'absent', - enabled: '0', - gpgcheck: '1' - ) - end -end - -shared_examples_for :epel_testing_debuginfo_7 do - include_context :epel_testing_debuginfo - - it do - is_expected.to contain_yumrepo('epel-testing-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug' - ) - end -end - -shared_examples_for :epel_testing_debuginfo_6 do - include_context :epel_testing_debuginfo - - it do - is_expected.to contain_yumrepo('epel-testing-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug' - ) - end -end - -shared_examples_for :epel_testing_debuginfo_5 do - include_context :epel_testing_debuginfo - - it do - is_expected.to contain_yumrepo('epel-testing-debuginfo').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=testing-debug-epel5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - Testing - $basearch - Debug' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/classes/shared_testing_source.rb --- a/modules/epel/spec/classes/shared_testing_source.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -require 'spec_helper' - -shared_examples :epel_testing_source do - it do - is_expected.to contain_yumrepo('epel-testing-source').with( - failovermethod: 'priority', - proxy: 'absent', - enabled: '0', - gpgcheck: '1' - ) - end -end - -shared_examples_for :epel_testing_source_7 do - include_context :epel_testing_source - - it do - is_expected.to contain_yumrepo('epel-testing-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7', - descr: 'Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source' - ) - end -end - -shared_examples_for :epel_testing_source_6 do - include_context :epel_testing_source - - it do - is_expected.to contain_yumrepo('epel-testing-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6', - descr: 'Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source' - ) - end -end - -shared_examples_for :epel_testing_source_5 do - include_context :epel_testing_source - - it do - is_expected.to contain_yumrepo('epel-testing-source').with( - mirrorlist: 'https://mirrors.fedoraproject.org/mirrorlist?repo=testing-source-epel5&arch=$basearch', - gpgkey: 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5', - descr: 'Extra Packages for Enterprise Linux 5 - Testing - $basearch - Source' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/defines/rpm_gpg_key_spec.rb --- a/modules/epel/spec/defines/rpm_gpg_key_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -require 'spec_helper' - -describe 'epel::rpm_gpg_key' do - context 'operatingsystemmajrelease => 7' do - let :facts do - default_facts.merge( - operatingsystemrelease: '7.0.1406', - operatingsystemmajrelease: '7' - ) - end - - let :title do - 'EPEL-7' - end - - let :params do - { - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7' - } - end - - it do - is_expected.to contain_exec("import-#{title}").with( - path: '/bin:/usr/bin:/sbin:/usr/sbin', - command: "rpm --import #{params[:path]}", - unless: "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids --keyid-format short < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", - require: "File[#{params[:path]}]", - logoutput: 'on_failure' - ) - end - end - - context 'operatingsystemmajrelease => 6' do - let :facts do - default_facts.merge( - operatingsystemrelease: '6.4', - operatingsystemmajrelease: '6' - ) - end - - let :title do - 'EPEL-6' - end - - let :params do - { - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6' - } - end - - it do - is_expected.to contain_exec("import-#{title}").with( - path: '/bin:/usr/bin:/sbin:/usr/sbin', - command: "rpm --import #{params[:path]}", - unless: "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids --keyid-format short < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", - require: "File[#{params[:path]}]", - logoutput: 'on_failure' - ) - end - end - - context 'operatingsystemmajrelease => 5' do - let :facts do - default_facts.merge( - operatingsystemrelease: '5.9', - operatingsystemmajrelease: '5' - ) - end - - let :title do - 'EPEL-5' - end - - let :params do - { - path: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5' - } - end - - it do - is_expected.to contain_exec("import-#{title}").with( - path: '/bin:/usr/bin:/sbin:/usr/sbin', - command: "rpm --import #{params[:path]}", - unless: "rpm -q gpg-pubkey-$(echo $(gpg --throw-keyids --keyid-format short < #{params[:path]}) | cut --characters=11-18 | tr '[A-Z]' '[a-z]')", - require: "File[#{params[:path]}]", - logoutput: 'on_failure' - ) - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/spec_helper.rb --- a/modules/epel/spec/spec_helper.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,8 +0,0 @@ -require 'puppetlabs_spec_helper/module_spec_helper' - -def default_facts - { - osfamily: 'RedHat', - operatingsystem: 'CentOS' - } -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/spec_helper_system.rb --- a/modules/epel/spec/spec_helper_system.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -require 'rspec-system/spec_helper' -require 'rspec-system-puppet/helpers' - -include RSpecSystemPuppet::Helpers - -RSpec.configure do |c| - # Project root for the this module's code - proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) - - # Enable colour in Jenkins - c.tty = true - - c.include RSpecSystemPuppet::Helpers - - # This is where we 'setup' the nodes before running our tests - c.before :suite do - # Install puppet - puppet_install - puppet_master_install - - puppet_module_install( - source: proj_root, - module_name: 'epel' - ) - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/system/basic_spec.rb --- a/modules/epel/spec/system/basic_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -require 'spec_helper_system' - -describe 'epel class:' do - context puppet_agent do - its(:stderr) { is_expected.to be_empty } - its(:exit_code) { is_expected.not_to == 1 } - end - - # Verify the operatingsystemmajrelease fact is working - context shell 'facter --puppet operatingsystemmajrelease' do - its(:stdout) { is_expected.not_to be_empty } - its(:stderr) { is_expected.to be_empty } - its(:exit_code) { is_expected.to be_zero } - end - - pp = "class { 'epel': }" - - context puppet_apply pp do - its(:stderr) { is_expected.to be_empty } - its(:refresh) { is_expected.to be_nil } - its(:exit_code) { is_expected.to be_zero } - end - - context 'test EPEL repo presence' do - facts = node.facts - - # Only test for EPEL's presence if not Fedora - if facts['operatingsystem'] !~ %r{Fedora} - context shell '/usr/bin/yum-config-manager epel | grep -q "\[epel\]"' do - its(:exit_code) { is_expected.to be_zero } - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/spec/system/usage_spec.rb --- a/modules/epel/spec/system/usage_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -require 'spec_helper_system' - -describe 'standage usage tests:' do - context 'test epel baseurl and mirrorlist' do - facts = node.facts - operatingsystemmajrelease = facts['operatingsystemrelease'].split('.')[0] - pp = <<-EOS - class { 'epel': - epel_baseurl => 'http://dl.fedoraproject.org/pub/epel/#{operatingsystemmajrelease}/x86_64/', - epel_mirrorlist => 'absent', - } - EOS - - context puppet_apply pp do - its(:stderr) { is_expected.to be_empty } - its(:refresh) { is_expected.to be_nil } - its(:exit_code) { is_expected.to be_zero } - end - - # Only test for EPEL's presence if not Fedora - if facts['operatingsystem'] !~ %r{Fedora} - # Test the yum config to ensure mirrorlist was emptied - context shell '/usr/bin/yum-config-manager epel | egrep "^mirrorlist ="' do - its(:stdout) { is_expected.to =~ %r{mirrorlist =\s+} } - end - - # Test the yum config to ensure baseurl was defined - context shell '/usr/bin/yum-config-manager epel | egrep "^baseurl ="' do - its(:stdout) { is_expected.to =~ %r{baseurl = http:\/\/dl.fedoraproject.org\/pub\/epel\/#{operatingsystemmajrelease}\/x86_64\/} } - end - end - end - - context 'test epel-testing is enabled' do - facts = node.facts - pp = <<-EOS - class { 'epel': - epel_testing_enabled => '1', - } - EOS - - context puppet_apply pp do - its(:stderr) { is_expected.to be_empty } - its(:refresh) { is_expected.to be_nil } - its(:exit_code) { is_expected.to be_zero } - end - - # Only test for EPEL's presence if not Fedora - if facts['operatingsystem'] !~ %r{Fedora} - # Test the yum config to ensure epel-testing was enabled - context shell '/usr/bin/yum-config-manager epel-testing | grep -q "enabled = True"' do - its(:exit_code) { is_expected.to be_zero } - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/templates/RPM-GPG-KEY-EPEL-5.erb --- a/modules/epel/templates/RPM-GPG-KEY-EPEL-5.erb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.2.6 (GNU/Linux) - -mQGiBEXopTIRBACZDBMOoFOakAjaxw1LXjeSvh/kmE35fU1rXfM7T0AV31NATCLF -l5CQiNDA4oWreDThg2Bf6+LIVTsGQb1V+XXuLak4Em5yTYwMTVB//4/nMxQEbpl/ -QB2XwlJ7EQ0vW+kiPDz/7pHJz1p1jADzd9sQQicMtzysS4qT2i5A23j0VwCg1PB/ -lpYqo0ZhWTrevxKMa1n34FcD/REavj0hSLQFTaKNLHRotRTF8V0BajjSaTkUT4uk -/RTaZ8Kr1mTosVtosqmdIAA2XHxi8ZLiVPPSezJjfElsSqOAxEKPL0djfpp2wrTm -l/1iVnX+PZH5DRKCbjdCMLDJhYap7YUhcPsMGSeUKrwmBCBJUPc6DhjFvyhA9IMl -1T0+A/9SKTv94ToP/JYoCTHTgnG5MoVNafisfe0wojP2mWU4gRk8X4dNGKMj6lic -vM6gne3hESyjcqZSmr7yELPPGhI9MNauJ6Ob8cTR2T12Fmv9w03DD3MnBstR6vhP -QcqZKhc5SJYYY7oVfxlSOfF4xfwcHQKoD5TOKwIAQ6T8jyFpKbQkRmVkb3JhIEVQ -RUwgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iGQEExECACQFAkXopTICGwMFCRLM -AwAGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQEZzANiF1IfabmQCgzvE60MnHSOBa -ZXXF7uU2Vzu8EOkAoKg9h+j0NuNom6WUYZyJQt4zc5seuQINBEXopTYQCADapnR/ -blrJ8FhlgNPl0X9S3JE/kygPbNXIqne4XBVYisVp0uzNCRUxNZq30MpY027JCs2J -nL2fMpwvx33f0phU029vrIZKA3CmnnwVsjcWfMJOVPBmVN7m5bGU68F+PdRIcDsl -PMOWRLkTBZOGolLgIbM4719fqA8etewILrX6uPvRDwywV7/sPCFpRcfNNBUY+Zx3 -5bf4fnkaCKxgXgQS3AT+hGYhlzIqQVTkGNveHTnt4SSzgAqR9sSwQwqvEfVtYNeS -w5rDguLG41HQm1Hojv59HNYjH6F/S1rClZi21bLgZbKpCFX76qPt8CTw+iQLBPPd -yoOGHfzyp7nsfhUrAAMFB/9/H9Gpk822ZpBexQW4y3LGFo9ZSnmu+ueOZPU3SqDA -DW1ovZdYzGuJTGGM9oMl6bL8eZrcUBBOFaWge5wZczIE3hx2exEOkDdvq+MUDVD1 -axmN45q/7h1NYRp5GQL2ZsoV4g9U2gMdzHOFtZCER6PP9ErVlfJpgBUCdSL93V4H -Sgpkk7znmTOklbCM6l/G/A6q4sCRqfzHwVSTiruyTBiU9lfROsAl8fjIq2OzWJ2T -P9sadBe1llUYaow7txYSUxssW+89avct35gIyrBbof5M+CBXyAOUaSWmpM2eub24 -0qbqiSr/Y6Om0t6vSzR8gRk7g+1H6IE0Tt1IJCvCAMimiE8EGBECAA8FAkXopTYC -GwwFCRLMAwAACgkQEZzANiF1IfZQYgCgiZHCv4xb+sTHCn/otc1Ovvi/OgMAnRXY -bbsLFWOfmzAnNIGvFRWy+YHi -=MMNL ------END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/templates/RPM-GPG-KEY-EPEL-6.erb --- a/modules/epel/templates/RPM-GPG-KEY-EPEL-6.erb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.5 (GNU/Linux) - -mQINBEvSKUIBEADLGnUj24ZVKW7liFN/JA5CgtzlNnKs7sBg7fVbNWryiE3URbn1 -JXvrdwHtkKyY96/ifZ1Ld3lE2gOF61bGZ2CWwJNee76Sp9Z+isP8RQXbG5jwj/4B -M9HK7phktqFVJ8VbY2jfTjcfxRvGM8YBwXF8hx0CDZURAjvf1xRSQJ7iAo58qcHn -XtxOAvQmAbR9z6Q/h/D+Y/PhoIJp1OV4VNHCbCs9M7HUVBpgC53PDcTUQuwcgeY6 -pQgo9eT1eLNSZVrJ5Bctivl1UcD6P6CIGkkeT2gNhqindRPngUXGXW7Qzoefe+fV -QqJSm7Tq2q9oqVZ46J964waCRItRySpuW5dxZO34WM6wsw2BP2MlACbH4l3luqtp -Xo3Bvfnk+HAFH3HcMuwdaulxv7zYKXCfNoSfgrpEfo2Ex4Im/I3WdtwME/Gbnwdq -3VJzgAxLVFhczDHwNkjmIdPAlNJ9/ixRjip4dgZtW8VcBCrNoL+LhDrIfjvnLdRu -vBHy9P3sCF7FZycaHlMWP6RiLtHnEMGcbZ8QpQHi2dReU1wyr9QgguGU+jqSXYar -1yEcsdRGasppNIZ8+Qawbm/a4doT10TEtPArhSoHlwbvqTDYjtfV92lC/2iwgO6g -YgG9XrO4V8dV39Ffm7oLFfvTbg5mv4Q/E6AWo/gkjmtxkculbyAvjFtYAQARAQAB -tCFFUEVMICg2KSA8ZXBlbEBmZWRvcmFwcm9qZWN0Lm9yZz6JAjYEEwECACAFAkvS -KUICGw8GCwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRA7Sd8qBgi4lR/GD/wLGPv9 -qO39eyb9NlrwfKdUEo1tHxKdrhNz+XYrO4yVDTBZRPSuvL2yaoeSIhQOKhNPfEgT -9mdsbsgcfmoHxmGVcn+lbheWsSvcgrXuz0gLt8TGGKGGROAoLXpuUsb1HNtKEOwP -Q4z1uQ2nOz5hLRyDOV0I2LwYV8BjGIjBKUMFEUxFTsL7XOZkrAg/WbTH2PW3hrfS -WtcRA7EYonI3B80d39ffws7SmyKbS5PmZjqOPuTvV2F0tMhKIhncBwoojWZPExft -HpKhzKVh8fdDO/3P1y1Fk3Cin8UbCO9MWMFNR27fVzCANlEPljsHA+3Ez4F7uboF -p0OOEov4Yyi4BEbgqZnthTG4ub9nyiupIZ3ckPHr3nVcDUGcL6lQD/nkmNVIeLYP -x1uHPOSlWfuojAYgzRH6LL7Idg4FHHBA0to7FW8dQXFIOyNiJFAOT2j8P5+tVdq8 -wB0PDSH8yRpn4HdJ9RYquau4OkjluxOWf0uRaS//SUcCZh+1/KBEOmcvBHYRZA5J -l/nakCgxGb2paQOzqqpOcHKvlyLuzO5uybMXaipLExTGJXBlXrbbASfXa/yGYSAG -iVrGz9CE6676dMlm8F+s3XXE13QZrXmjloc6jwOljnfAkjTGXjiB7OULESed96MR -XtfLk0W5Ab9pd7tKDR6QHI7rgHXfCopRnZ2VVQ== -=V/6I ------END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/templates/RPM-GPG-KEY-EPEL-7.erb --- a/modules/epel/templates/RPM-GPG-KEY-EPEL-7.erb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.11 (GNU/Linux) - -mQINBFKuaIQBEAC1UphXwMqCAarPUH/ZsOFslabeTVO2pDk5YnO96f+rgZB7xArB -OSeQk7B90iqSJ85/c72OAn4OXYvT63gfCeXpJs5M7emXkPsNQWWSju99lW+AqSNm -jYWhmRlLRGl0OO7gIwj776dIXvcMNFlzSPj00N2xAqjMbjlnV2n2abAE5gq6VpqP -vFXVyfrVa/ualogDVmf6h2t4Rdpifq8qTHsHFU3xpCz+T6/dGWKGQ42ZQfTaLnDM -jToAsmY0AyevkIbX6iZVtzGvanYpPcWW4X0RDPcpqfFNZk643xI4lsZ+Y2Er9Yu5 -S/8x0ly+tmmIokaE0wwbdUu740YTZjCesroYWiRg5zuQ2xfKxJoV5E+Eh+tYwGDJ -n6HfWhRgnudRRwvuJ45ztYVtKulKw8QQpd2STWrcQQDJaRWmnMooX/PATTjCBExB -9dkz38Druvk7IkHMtsIqlkAOQMdsX1d3Tov6BE2XDjIG0zFxLduJGbVwc/6rIc95 -T055j36Ez0HrjxdpTGOOHxRqMK5m9flFbaxxtDnS7w77WqzW7HjFrD0VeTx2vnjj -GqchHEQpfDpFOzb8LTFhgYidyRNUflQY35WLOzLNV+pV3eQ3Jg11UFwelSNLqfQf -uFRGc+zcwkNjHh5yPvm9odR1BIfqJ6sKGPGbtPNXo7ERMRypWyRz0zi0twARAQAB -tChGZWRvcmEgRVBFTCAoNykgPGVwZWxAZmVkb3JhcHJvamVjdC5vcmc+iQI4BBMB -AgAiBQJSrmiEAhsPBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBqL66iNSxk -5cfGD/4spqpsTjtDM7qpytKLHKruZtvuWiqt5RfvT9ww9GUUFMZ4ZZGX4nUXg49q -ixDLayWR8ddG/s5kyOi3C0uX/6inzaYyRg+Bh70brqKUK14F1BrrPi29eaKfG+Gu -MFtXdBG2a7OtPmw3yuKmq9Epv6B0mP6E5KSdvSRSqJWtGcA6wRS/wDzXJENHp5re -9Ism3CYydpy0GLRA5wo4fPB5uLdUhLEUDvh2KK//fMjja3o0L+SNz8N0aDZyn5Ax -CU9RB3EHcTecFgoy5umRj99BZrebR1NO+4gBrivIfdvD4fJNfNBHXwhSH9ACGCNv -HnXVjHQF9iHWApKkRIeh8Fr2n5dtfJEF7SEX8GbX7FbsWo29kXMrVgNqHNyDnfAB -VoPubgQdtJZJkVZAkaHrMu8AytwT62Q4eNqmJI1aWbZQNI5jWYqc6RKuCK6/F99q -thFT9gJO17+yRuL6Uv2/vgzVR1RGdwVLKwlUjGPAjYflpCQwWMAASxiv9uPyYPHc -ErSrbRG0wjIfAR3vus1OSOx3xZHZpXFfmQTsDP7zVROLzV98R3JwFAxJ4/xqeON4 -vCPFU6OsT3lWQ8w7il5ohY95wmujfr6lk89kEzJdOTzcn7DBbUru33CQMGKZ3Evt -RjsC7FDbL017qxS+ZVA/HGkyfiu4cpgV8VUnbql5eAZ+1Ll6Dw== -=hdPa ------END PGP PUBLIC KEY BLOCK----- diff -r 3fce34f642f1 -r 66c075c5f54a modules/epel/tests/init.pp --- a/modules/epel/tests/init.pp Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -# And by test, I mean, run this thing for me using Puppet apply and I'll check -# it out. -include '::epel' diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/CHANGELOG.md --- a/modules/python/CHANGELOG.md Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/CHANGELOG.md Mon Jan 03 17:13:06 2022 +0000 @@ -4,6 +4,158 @@ Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module. +## [v6.2.1](https://github.com/voxpupuli/puppet-python/tree/v6.2.1) (2021-12-10) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.2.0...v6.2.1) + +**Fixed bugs:** + +- Correct python::pip::environment parameter example [\#629](https://github.com/voxpupuli/puppet-python/pull/629) ([traylenator](https://github.com/traylenator)) +- gunicorn: RHEL8 has a different package name [\#628](https://github.com/voxpupuli/puppet-python/pull/628) ([yakatz](https://github.com/yakatz)) +- Remove duplicate arguments in the pip install command [\#627](https://github.com/voxpupuli/puppet-python/pull/627) ([zanyou](https://github.com/zanyou)) + +**Closed issues:** + +- Package with provider pip3 tries installing every run. [\#626](https://github.com/voxpupuli/puppet-python/issues/626) + +**Merged pull requests:** + +- modulesync 5.1.0 & puppet-lint: fix params\_empty\_string\_assignment [\#631](https://github.com/voxpupuli/puppet-python/pull/631) ([bastelfreak](https://github.com/bastelfreak)) + +## [v6.2.0](https://github.com/voxpupuli/puppet-python/tree/v6.2.0) (2021-08-26) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.1.0...v6.2.0) + +**Implemented enhancements:** + +- Add support for Debian 11 [\#621](https://github.com/voxpupuli/puppet-python/pull/621) ([smortex](https://github.com/smortex)) + +**Merged pull requests:** + +- Allow stdlib 8.0.0 [\#622](https://github.com/voxpupuli/puppet-python/pull/622) ([smortex](https://github.com/smortex)) + +## [v6.1.0](https://github.com/voxpupuli/puppet-python/tree/v6.1.0) (2021-06-05) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.0.1...v6.1.0) + +Due to a bug in the release pipeline, release v6.0.1 didn't make it to the forge. v6.0.2 just contains [modulesync 4.1.0](https://github.com/voxpupuli/modulesync_config/blob/master/CHANGELOG.md#410-2021-04-03) patch. + +**Implemented enhancements:** + +- Add support for FreeBSD [\#612](https://github.com/voxpupuli/puppet-python/pull/612) ([smortex](https://github.com/smortex)) + +**Closed issues:** + +- Can't uninstall pip package because of duplicate variable name [\#532](https://github.com/voxpupuli/puppet-python/issues/532) +- audit metaparameter is deprecated [\#375](https://github.com/voxpupuli/puppet-python/issues/375) + +## [v6.0.1](https://github.com/voxpupuli/puppet-python/tree/v6.0.1) (2021-04-29) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v6.0.0...v6.0.1) + +**Fixed bugs:** + +- Use $real\_pkgname for pip uninstall command [\#607](https://github.com/voxpupuli/puppet-python/pull/607) ([brabiega](https://github.com/brabiega)) + +**Closed issues:** + +- Pip uninstall does not support pkgname variable [\#606](https://github.com/voxpupuli/puppet-python/issues/606) + +## [v6.0.0](https://github.com/voxpupuli/puppet-python/tree/v6.0.0) (2021-04-03) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v5.0.0...v6.0.0) + +**Breaking changes:** + +- Drop Puppet 5 support [\#603](https://github.com/voxpupuli/puppet-python/pull/603) ([bastelfreak](https://github.com/bastelfreak)) +- Drop python::virtualenv defined resource [\#596](https://github.com/voxpupuli/puppet-python/pull/596) ([bastelfreak](https://github.com/bastelfreak)) +- Set default python to 3 [\#595](https://github.com/voxpupuli/puppet-python/pull/595) ([bastelfreak](https://github.com/bastelfreak)) + +**Implemented enhancements:** + +- Add the possibility to specify the pip version in virtual envs [\#599](https://github.com/voxpupuli/puppet-python/pull/599) ([SaschaDoering](https://github.com/SaschaDoering)) +- Add Support for RedHat/CentOS 8 [\#594](https://github.com/voxpupuli/puppet-python/pull/594) ([treydock](https://github.com/treydock)) +- enhance pyvenv tests [\#590](https://github.com/voxpupuli/puppet-python/pull/590) ([bastelfreak](https://github.com/bastelfreak)) +- Add Debian 10 support [\#573](https://github.com/voxpupuli/puppet-python/pull/573) ([bastelfreak](https://github.com/bastelfreak)) + +**Fixed bugs:** + +- Fix python::virtualenv to allow virtualenv to not require absolute path [\#592](https://github.com/voxpupuli/puppet-python/pull/592) ([treydock](https://github.com/treydock)) +- python::gunicorn: Fix typo in datatype [\#585](https://github.com/voxpupuli/puppet-python/pull/585) ([bastelfreak](https://github.com/bastelfreak)) + +**Closed issues:** + +- Setting Pip Version for Virtual Environments [\#559](https://github.com/voxpupuli/puppet-python/issues/559) +- Can't install this using librarian-puppet [\#406](https://github.com/voxpupuli/puppet-python/issues/406) + +**Merged pull requests:** + +- puppetlabs/stdlib: Allow 7.x [\#604](https://github.com/voxpupuli/puppet-python/pull/604) ([bastelfreak](https://github.com/bastelfreak)) +- Support Puppet 7 [\#602](https://github.com/voxpupuli/puppet-python/pull/602) ([mattock](https://github.com/mattock)) +- Support Ubuntu 20.04 [\#593](https://github.com/voxpupuli/puppet-python/pull/593) ([treydock](https://github.com/treydock)) +- Add pyvenv acceptance test [\#588](https://github.com/voxpupuli/puppet-python/pull/588) ([bastelfreak](https://github.com/bastelfreak)) +- General linting/indent/syntax [\#580](https://github.com/voxpupuli/puppet-python/pull/580) ([crazymind1337](https://github.com/crazymind1337)) +- Use Python 3 for virtualenv tests [\#575](https://github.com/voxpupuli/puppet-python/pull/575) ([waipeng](https://github.com/waipeng)) +- Add acceptance test for managing Python 3 [\#572](https://github.com/voxpupuli/puppet-python/pull/572) ([bastelfreak](https://github.com/bastelfreak)) + +## [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) + +**Fixed bugs:** + +- Fixes for virtualenv\_version fact when virtualenv \> 20.x [\#537](https://github.com/voxpupuli/puppet-python/pull/537) ([pjonesIDBS](https://github.com/pjonesIDBS)) + +## [v4.1.0](https://github.com/voxpupuli/puppet-python/tree/v4.1.0) (2020-04-26) + +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v4.0.0...v4.1.0) + +**Implemented enhancements:** + +- Add option for not managing python and virtualenv packages. [\#500](https://github.com/voxpupuli/puppet-python/pull/500) ([tdukaric](https://github.com/tdukaric)) + +**Fixed bugs:** + +- Wrong pip referenced inside virtualenv [\#505](https://github.com/voxpupuli/puppet-python/issues/505) +- CentOS: Fix ordering dependency [\#546](https://github.com/voxpupuli/puppet-python/pull/546) ([bastelfreak](https://github.com/bastelfreak)) +- switch from stahnma/epel to puppet/epel / Ubuntu 16.04: Execute tests on Python 3 [\#545](https://github.com/voxpupuli/puppet-python/pull/545) ([bastelfreak](https://github.com/bastelfreak)) +- Remove resource collector overriding pip\_provider [\#511](https://github.com/voxpupuli/puppet-python/pull/511) ([jplindquist](https://github.com/jplindquist)) + +**Closed issues:** + +- python3.6+ venv proper installation command [\#533](https://github.com/voxpupuli/puppet-python/issues/533) +- Virtualenv doesn't install with the right python [\#384](https://github.com/voxpupuli/puppet-python/issues/384) + +**Merged pull requests:** + +- Use voxpupuli-acceptance [\#543](https://github.com/voxpupuli/puppet-python/pull/543) ([ekohl](https://github.com/ekohl)) +- update repo links to https [\#531](https://github.com/voxpupuli/puppet-python/pull/531) ([bastelfreak](https://github.com/bastelfreak)) + ## [v4.0.0](https://github.com/voxpupuli/puppet-python/tree/v4.0.0) (2019-12-10) [Full Changelog](https://github.com/voxpupuli/puppet-python/compare/v3.0.1...v4.0.0) @@ -65,7 +217,7 @@ **Fixed bugs:** - Installing from git repo runs install on every Puppet run [\#193](https://github.com/voxpupuli/puppet-python/issues/193) -- Fix python::pip installing $editable VCS packages every Puppet run [\#491](https://github.com/voxpupuli/puppet-python/pull/491) ([wolttam](https://github.com/wolttam)) +- Fix python::pip installing $editable VCS packages every Puppet run [\#491](https://github.com/voxpupuli/puppet-python/pull/491) ([mlow](https://github.com/mlow)) - Fix $subscribe overloading [\#490](https://github.com/voxpupuli/puppet-python/pull/490) ([nward](https://github.com/nward)) - Fix version-check. [\#489](https://github.com/voxpupuli/puppet-python/pull/489) ([pillarsdotnet](https://github.com/pillarsdotnet)) - Update version validation [\#472](https://github.com/voxpupuli/puppet-python/pull/472) ([bodgit](https://github.com/bodgit)) @@ -98,7 +250,7 @@ **Merged pull requests:** - 486 Set permissive umask. [\#487](https://github.com/voxpupuli/puppet-python/pull/487) ([pillarsdotnet](https://github.com/pillarsdotnet)) -- Update `puppetlabs/stdlib` dependency to allow 6.x and require at least 4.19.0 \(where the `fact\(\)` function was introduced\) [\#485](https://github.com/voxpupuli/puppet-python/pull/485) ([pillarsdotnet](https://github.com/pillarsdotnet)) +- Update `puppetlabs/stdlib` dependency to allow 6.x and require at least 4.19.0 \(where the `fact()` function was introduced\) [\#485](https://github.com/voxpupuli/puppet-python/pull/485) ([pillarsdotnet](https://github.com/pillarsdotnet)) - Update pip url regex to support 'git+git://\' [\#477](https://github.com/voxpupuli/puppet-python/pull/477) ([gharper](https://github.com/gharper)) - README.md: remove obsolete and redundant sections [\#453](https://github.com/voxpupuli/puppet-python/pull/453) ([kenyon](https://github.com/kenyon)) - remove .DS\_Store [\#452](https://github.com/voxpupuli/puppet-python/pull/452) ([kenyon](https://github.com/kenyon)) @@ -195,7 +347,7 @@ **Merged pull requests:** -- Fix Python version regex in install.pp [\#410](https://github.com/voxpupuli/puppet-python/pull/410) ([fklajn-opera](https://github.com/fklajn-opera)) +- Fix Python version regex in install.pp [\#410](https://github.com/voxpupuli/puppet-python/pull/410) ([fklajn](https://github.com/fklajn)) - Remove docker nodesets [\#408](https://github.com/voxpupuli/puppet-python/pull/408) ([bastelfreak](https://github.com/bastelfreak)) - Update README compatibility section [\#405](https://github.com/voxpupuli/puppet-python/pull/405) ([rkcpi](https://github.com/rkcpi)) - add secret for forge deployment via travis [\#404](https://github.com/voxpupuli/puppet-python/pull/404) ([bastelfreak](https://github.com/bastelfreak)) @@ -225,7 +377,7 @@ - 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) ([PuppetNinja](https://github.com/PuppetNinja)) +- 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)) @@ -243,7 +395,7 @@ ## [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:** @@ -255,23 +407,15 @@ - 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) @@ -287,24 +431,12 @@ ## [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) @@ -341,23 +473,20 @@ ## [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) +[Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.12.0...1.13.0) **Closed issues:** - SCL package installation returns an error [\#308](https://github.com/voxpupuli/puppet-python/issues/308) +- Patch Release [\#295](https://github.com/voxpupuli/puppet-python/issues/295) - Can't install pip3 with Ubuntu [\#287](https://github.com/voxpupuli/puppet-python/issues/287) - SCL python27: add a workaround for libpython2.7.so.1.0 issue \(LD\_LIBRARY\_PATH\) [\#234](https://github.com/voxpupuli/puppet-python/issues/234) @@ -373,30 +502,6 @@ - Configure workers [\#301](https://github.com/voxpupuli/puppet-python/pull/301) ([steverecio](https://github.com/steverecio)) - Fix support for Ruby 1.8.7 [\#298](https://github.com/voxpupuli/puppet-python/pull/298) ([ghoneycutt](https://github.com/ghoneycutt)) -## [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) - -**Closed issues:** - -- Patch Release [\#295](https://github.com/voxpupuli/puppet-python/issues/295) - ## [1.12.0](https://github.com/voxpupuli/puppet-python/tree/1.12.0) (2016-03-27) [Full Changelog](https://github.com/voxpupuli/puppet-python/compare/1.11.0...1.12.0) @@ -651,7 +756,7 @@ **Closed issues:** -- Unable to customize `APP\_MODULE` variable in gunicorn template [\#127](https://github.com/voxpupuli/puppet-python/issues/127) +- Unable to customize `APP_MODULE` variable in gunicorn template [\#127](https://github.com/voxpupuli/puppet-python/issues/127) - New release on the Puppet forge [\#125](https://github.com/voxpupuli/puppet-python/issues/125) ## [1.7.10](https://github.com/voxpupuli/puppet-python/tree/1.7.10) (2014-09-25) diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/Gemfile --- a/modules/python/Gemfile Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -source ENV['GEM_SOURCE'] || "https://rubygems.org" - -def location_for(place, fake_version = nil) - if place =~ /^(git[:@][^#]*)#(.*)/ - [fake_version, { :git => $1, :branch => $2, :require => false }].compact - elsif place =~ /^file:\/\/(.*)/ - ['>= 0', { :path => File.expand_path($1), :require => false }] - else - [place, { :require => false }] - end -end - -group :test do - gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false - gem 'rspec-puppet-facts', '>= 1.9.5', :require => false - gem 'rspec-puppet-utils', :require => false - gem 'puppet-lint-leading_zero-check', :require => false - gem 'puppet-lint-trailing_comma-check', :require => false - gem 'puppet-lint-version_comparison-check', :require => false - gem 'puppet-lint-classes_and_types_beginning_with_digits-check', :require => false - gem 'puppet-lint-unquoted_string-check', :require => false - gem 'puppet-lint-variable_contains_upcase', :require => false - gem 'puppet-lint-absolute_classname-check', :require => false - gem 'puppet-lint-topscope-variable-check', :require => false - gem 'puppet-lint-legacy_facts-check', :require => false - gem 'puppet-lint-anchor-check', :require => false - gem 'metadata-json-lint', :require => false - gem 'redcarpet', :require => false - gem 'rubocop', '~> 0.49.1', :require => false - gem 'rubocop-rspec', '~> 1.15.0', :require => false - gem 'mocha', '~> 1.4.0', :require => false - gem 'coveralls', :require => false - gem 'simplecov-console', :require => false - gem 'parallel_tests', :require => false -end - -group :development do - gem 'travis', :require => false - gem 'travis-lint', :require => false - gem 'guard-rake', :require => false - gem 'overcommit', '>= 0.39.1', :require => false -end - -group :system_tests do - gem 'winrm', :require => false - if beaker_version = ENV['BEAKER_VERSION'] - gem 'beaker', *location_for(beaker_version) - else - gem 'beaker', '>= 4.2.0', :require => false - end - if beaker_rspec_version = ENV['BEAKER_RSPEC_VERSION'] - gem 'beaker-rspec', *location_for(beaker_rspec_version) - else - gem 'beaker-rspec', :require => false - end - gem 'serverspec', :require => false - gem 'beaker-hostgenerator', '>= 1.1.22', :require => false - gem 'beaker-docker', :require => false - gem 'beaker-puppet', :require => false - gem 'beaker-puppet_install_helper', :require => false - gem 'beaker-module_install_helper', :require => false - gem 'rbnacl', '>= 4', :require => false - gem 'rbnacl-libsodium', :require => false - gem 'bcrypt_pbkdf', :require => false -end - -group :release do - gem 'github_changelog_generator', :require => false, :git => 'https://github.com/voxpupuli/github-changelog-generator', :branch => 'voxpupuli_essential_fixes' - gem 'puppet-blacksmith', :require => false - gem 'voxpupuli-release', :require => false - gem 'puppet-strings', '>= 2.2', :require => false -end - - - -if facterversion = ENV['FACTER_GEM_VERSION'] - gem 'facter', facterversion.to_s, :require => false, :groups => [:test] -else - gem 'facter', :require => false, :groups => [:test] -end - -ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s -gem 'puppet', puppetversion, :require => false, :groups => [:test] - -# vim: syntax=ruby diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/README.md --- a/modules/python/README.md Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/README.md Mon Jan 03 17:13:06 2022 +0000 @@ -1,11 +1,13 @@ # puppet-python -[![License](https://img.shields.io/github/license/voxpupuli/puppet-python.svg)](https://github.com/voxpupuli/puppet-python/blob/master/LICENSE) -[![Build Status](https://travis-ci.org/voxpupuli/puppet-python.png?branch=master)](https://travis-ci.org/voxpupuli/puppet-python) +[![Build Status](https://github.com/voxpupuli/puppet-python/workflows/CI/badge.svg)](https://github.com/voxpupuli/puppet-python/actions?query=workflow%3ACI) +[![Release](https://github.com/voxpupuli/puppet-python/actions/workflows/release.yml/badge.svg)](https://github.com/voxpupuli/puppet-python/actions/workflows/release.yml) [![Puppet Forge](https://img.shields.io/puppetforge/v/puppet/python.svg)](https://forge.puppetlabs.com/puppet/python) [![Puppet Forge - downloads](https://img.shields.io/puppetforge/dt/puppet/python.svg)](https://forge.puppetlabs.com/puppet/python) [![Puppet Forge - endorsement](https://img.shields.io/puppetforge/e/puppet/python.svg)](https://forge.puppetlabs.com/puppet/python) [![Puppet Forge - scores](https://img.shields.io/puppetforge/f/puppet/python.svg)](https://forge.puppetlabs.com/puppet/python) +[![puppetmodule.info docs](http://www.puppetmodule.info/images/badge.png)](http://www.puppetmodule.info/m/puppet-python) +[![License](https://img.shields.io/github/license/voxpupuli/puppet-python.svg)](https://github.com/voxpupuli/puppet-python/blob/master/LICENSE) Puppet module for installing and managing python, pip, virtualenvs and Gunicorn virtual hosts. diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/REFERENCE.md --- a/modules/python/REFERENCE.md Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/REFERENCE.md Mon Jan 03 17:13:06 2022 +0000 @@ -1,35 +1,44 @@ # Reference + ## Table of Contents -**Classes** +### Classes -_Public Classes_ +#### Public Classes -* [`python`](#python): Installs and manages python, python-dev, python-virtualenv and gunicorn. +* [`python`](#python): Installs and manages python, python-dev and gunicorn. * [`python::pip::bootstrap`](#pythonpipbootstrap): allow to bootstrap pip when python is managed from other module -_Private Classes_ +#### Private Classes * `python::config`: Optionally installs the gunicorn service * `python::install`: Installs core python packages * `python::params`: The python Module default configuration settings. -**Defined types** +### Defined types * [`python::dotfile`](#pythondotfile): Manages any python dotfiles with a simple config hash. * [`python::gunicorn`](#pythongunicorn): Manages Gunicorn virtual hosts. * [`python::pip`](#pythonpip): Installs and manages packages from pip. * [`python::pyvenv`](#pythonpyvenv): Create a Python3 virtualenv using pyvenv. * [`python::requirements`](#pythonrequirements): Installs and manages Python packages from requirements file. -* [`python::virtualenv`](#pythonvirtualenv): Creates Python virtualenv. + +### Data types + +* [`Python::Loglevel`](#pythonloglevel): A version type to match all valid loglevels for python +* [`Python::Package::Ensure`](#pythonpackageensure): A version type to match all valid package ensures for python +* [`Python::Provider`](#pythonprovider): A version type to match all valid provider for python +* [`Python::Umask`](#pythonumask): A version type to match valid umask for python +* [`Python::Venv::PipVersion`](#pythonvenvpipversion): A version type to ensure a specific Pip version in a virtual env. +* [`Python::Version`](#pythonversion): A version type to match all valid versions for python ## Classes -### python +### `python` -Installs and manages python, python-dev, python-virtualenv and gunicorn. +Installs and manages python, python-dev and gunicorn. #### Examples @@ -40,7 +49,6 @@ version => 'system', pip => 'present', dev => 'present', - virtualenv => 'present', gunicorn => 'present', } ``` @@ -52,25 +60,45 @@ ensure => 'present', version => 'rh-python36-python', dev => 'present', - virtualenv => 'present', } ``` #### Parameters -The following parameters are available in the `python` class. +The following parameters are available in the `python` class: -##### `ensure` +* [`ensure`](#ensure) +* [`version`](#version) +* [`pip`](#pip) +* [`dev`](#dev) +* [`gunicorn`](#gunicorn) +* [`manage_gunicorn`](#manage_gunicorn) +* [`provider`](#provider) +* [`use_epel`](#use_epel) +* [`manage_scl`](#manage_scl) +* [`umask`](#umask) +* [`manage_python_package`](#manage_python_package) +* [`manage_pip_package`](#manage_pip_package) +* [`gunicorn_package_name`](#gunicorn_package_name) +* [`python_pips`](#python_pips) +* [`python_pyvenvs`](#python_pyvenvs) +* [`python_requirements`](#python_requirements) +* [`python_dotfiles`](#python_dotfiles) +* [`rhscl_use_public_repository`](#rhscl_use_public_repository) +* [`anaconda_installer_url`](#anaconda_installer_url) +* [`anaconda_install_path`](#anaconda_install_path) -Data type: `Enum['absent', 'present', 'latest']` +##### `ensure` + +Data type: `Python::Package::Ensure` Desired installation state for the Python package. -Default value: $python::params::ensure +Default value: `$python::params::ensure` -##### `version` +##### `version` -Data type: `Any` +Data type: `Python::Version` Python version to install. Beware that valid values for this differ a) by the provider you choose and b) by the osfamily/operatingsystem you are using. Allowed values: @@ -81,161 +109,153 @@ - 3/3.3/... means you are going to install the python3/python3.3/... package, if available on your osfamily. -Default value: $python::params::version +Default value: `'3'` -##### `pip` +##### `pip` -Data type: `Enum['absent', 'present', 'latest']` +Data type: `Python::Package::Ensure` Desired installation state for the python-pip package. -Default value: $python::params::pip +Default value: `$python::params::pip` -##### `dev` +##### `dev` -Data type: `Enum['absent', 'present', 'latest']` +Data type: `Python::Package::Ensure` Desired installation state for the python-dev package. -Default value: $python::params::dev - -##### `virtualenv` - -Data type: `Enum['absent', 'present', 'latest']` +Default value: `$python::params::dev` -Desired installation state for the virtualenv package - -Default value: $python::params::virtualenv +##### `gunicorn` -##### `gunicorn` - -Data type: `Enum['absent', 'present', 'latest']` +Data type: `Python::Package::Ensure` Desired installation state for Gunicorn. -Default value: $python::params::gunicorn +Default value: `$python::params::gunicorn` -##### `manage_gunicorn` +##### `manage_gunicorn` Data type: `Boolean` Allow Installation / Removal of Gunicorn. -Default value: $python::params::manage_gunicorn +Default value: `$python::params::manage_gunicorn` -##### `provider` +##### `provider` -Data type: `Optional[Enum['pip', 'scl', 'rhscl', 'anaconda', '']]` +Data type: `Optional[Python::Provider]` What provider to use for installation of the packages, except gunicorn and Python itself. -Default value: $python::params::provider +Default value: `$python::params::provider` -##### `use_epel` +##### `use_epel` Data type: `Boolean` to determine if the epel class is used. -Default value: $python::params::use_epel +Default value: `$python::params::use_epel` -##### `manage_scl` +##### `manage_scl` Data type: `Boolean` Whether to manage core SCL packages or not. -Default value: $python::params::manage_scl +Default value: `$python::params::manage_scl` -##### `umask` +##### `umask` -Data type: `Optional[Pattern[/[0-7]{1,4}/]]` +Data type: `Optional[Python::Umask]` The default umask for invoked exec calls. -Default value: `undef` +Default value: ``undef`` -##### `gunicorn_package_name` +##### `manage_python_package` -Data type: `Any` +Data type: `Boolean` -Default value: $python::params::gunicorn_package_name +Default value: `$python::params::manage_python_package` -##### `valid_versions` +##### `manage_pip_package` -Data type: `Any` +Data type: `Boolean` -Default value: $python::params::valid_versions +Default value: `$python::params::manage_pip_package` -##### `python_pips` +##### `gunicorn_package_name` -Data type: `Hash` +Data type: `String[1]` -Default value: { } +Default value: `$python::params::gunicorn_package_name` -##### `python_virtualenvs` +##### `python_pips` Data type: `Hash` -Default value: { } +Default value: `{}` -##### `python_pyvenvs` +##### `python_pyvenvs` Data type: `Hash` -Default value: { } +Default value: `{}` -##### `python_requirements` +##### `python_requirements` Data type: `Hash` -Default value: { } +Default value: `{}` -##### `python_dotfiles` +##### `python_dotfiles` Data type: `Hash` -Default value: { } +Default value: `{}` -##### `rhscl_use_public_repository` +##### `rhscl_use_public_repository` -Data type: `Any` +Data type: `Boolean` -Default value: $python::params::rhscl_use_public_repository +Default value: `$python::params::rhscl_use_public_repository` -##### `anaconda_installer_url` +##### `anaconda_installer_url` Data type: `Stdlib::Httpurl` -Default value: $python::params::anaconda_installer_url +Default value: `$python::params::anaconda_installer_url` -##### `anaconda_install_path` +##### `anaconda_install_path` Data type: `Stdlib::Absolutepath` -Default value: $python::params::anaconda_install_path +Default value: `$python::params::anaconda_install_path` -### python::pip::bootstrap +### `python::pip::bootstrap` allow to bootstrap pip when python is managed from other module @@ -251,35 +271,48 @@ #### Parameters -The following parameters are available in the `python::pip::bootstrap` class. +The following parameters are available in the `python::pip::bootstrap` class: -##### `version` +* [`version`](#version) +* [`manage_python`](#manage_python) +* [`http_proxy`](#http_proxy) +* [`exec_provider`](#exec_provider) + +##### `version` Data type: `Enum['pip', 'pip3']` should be pip or pip3 -Default value: 'pip' +Default value: `'pip'` -##### `manage_python` +##### `manage_python` Data type: `Variant[Boolean, String]` if python module will manage deps -Default value: `false` +Default value: ``false`` -##### `http_proxy` +##### `http_proxy` Data type: `Optional[Stdlib::HTTPUrl]` Proxy server to use for outbound connections. -Default value: `undef` +Default value: ``undef`` + +##### `exec_provider` + +Data type: `String[1]` + + + +Default value: `'shell'` ## Defined types -### python::dotfile +### `python::dotfile` Manages any python dotfiles with a simple config hash. @@ -303,57 +336,64 @@ #### Parameters -The following parameters are available in the `python::dotfile` defined type. +The following parameters are available in the `python::dotfile` defined type: -##### `ensure` +* [`ensure`](#ensure) +* [`filename`](#filename) +* [`mode`](#mode) +* [`owner`](#owner) +* [`group`](#group) +* [`config`](#config) + +##### `ensure` Data type: `Enum['absent', 'present']` -Default value: 'present' +Default value: `'present'` -##### `filename` +##### `filename` -Data type: `String[1]` +Data type: `Stdlib::Absolutepath` Filename. -Default value: $title +Default value: `$title` -##### `mode` +##### `mode` Data type: `Stdlib::Filemode` File mode. -Default value: '0644' +Default value: `'0644'` -##### `owner` +##### `owner` Data type: `String[1]` user owner of dotfile -Default value: 'root' +Default value: `'root'` -##### `group` +##### `group` Data type: `String[1]` group owner of dotfile -Default value: 'root' +Default value: `'root'` -##### `config` +##### `config` Data type: `Hash` Config hash. This will be expanded to an ini-file. -Default value: {} +Default value: `{}` -### python::gunicorn +### `python::gunicorn` Manages Gunicorn virtual hosts. @@ -380,169 +420,190 @@ #### Parameters -The following parameters are available in the `python::gunicorn` defined type. +The following parameters are available in the `python::gunicorn` defined type: -##### `ensure` +* [`ensure`](#ensure) +* [`config_dir`](#config_dir) +* [`manage_config_dir`](#manage_config_dir) +* [`virtualenv`](#virtualenv) +* [`mode`](#mode) +* [`dir`](#dir) +* [`bind`](#bind) +* [`environment`](#environment) +* [`appmodule`](#appmodule) +* [`osenv`](#osenv) +* [`timeout`](#timeout) +* [`template`](#template) +* [`args`](#args) +* [`owner`](#owner) +* [`group`](#group) +* [`workers`](#workers) +* [`access_log_format`](#access_log_format) +* [`accesslog`](#accesslog) +* [`errorlog`](#errorlog) +* [`log_level`](#log_level) + +##### `ensure` Data type: `Enum['present', 'absent']` -Default value: present +Default value: `present` -##### `config_dir` +##### `config_dir` -Data type: `Any` +Data type: `Stdlib::Absolutepath` Configure the gunicorn config directory path. -Default value: '/etc/gunicorn.d' +Default value: `'/etc/gunicorn.d'` -##### `manage_config_dir` +##### `manage_config_dir` -Data type: `Any` +Data type: `Boolean` Set if the gunicorn config directory should be created. -Default value: `false` +Default value: ``false`` -##### `virtualenv` +##### `virtualenv` -Data type: `Any` +Data type: `Variant[Boolean,Stdlib::Absolutepath]` Run in virtualenv, specify directory. -Default value: `false` +Default value: ``false`` -##### `mode` +##### `mode` Data type: `Enum['wsgi', 'django']` Gunicorn mode. -Default value: 'wsgi' +Default value: `'wsgi'` -##### `dir` +##### `dir` Data type: `Stdlib::Absolutepath` Application directory. -##### `bind` +##### `bind` -Data type: `Any` +Data type: `Variant[String[1],Boolean]` Bind on: 'HOST', 'HOST:PORT', 'unix:PATH'. Default: system-wide: unix:/tmp/gunicorn-$name.socket virtualenv: unix:${virtualenv}/${name}.socket -Default value: `false` +Default value: ``false`` -##### `environment` +##### `environment` -Data type: `Any` +Data type: `Variant[String[1],Boolean]` Set ENVIRONMENT variable. -Default value: `false` +Default value: ``false`` -##### `appmodule` +##### `appmodule` -Data type: `Any` +Data type: `String[1]` Set the application module name for gunicorn to load when not using Django. -Default value: 'app:app' +Default value: `'app:app'` -##### `osenv` +##### `osenv` -Data type: `Any` +Data type: `Variant[Boolean,Hash]` Allows setting environment variables for the gunicorn service. Accepts a hash of 'key': 'value' pairs. -Default value: `false` +Default value: ``false`` -##### `timeout` +##### `timeout` -Data type: `Any` +Data type: `Integer` Allows setting the gunicorn idle worker process time before being killed. The unit of time is seconds. -Default value: 30 +Default value: `30` -##### `template` +##### `template` -Data type: `Any` +Data type: `String[1]` Which ERB template to use. -Default value: 'python/gunicorn.erb' +Default value: `'python/gunicorn.erb'` -##### `args` +##### `args` -Data type: `Any` +Data type: `Array` Custom arguments to add in gunicorn config file. -Default value: [] +Default value: `[]` -##### `owner` +##### `owner` -Data type: `Any` +Data type: `String[1]` -Default value: 'www-data' +Default value: `'www-data'` -##### `group` +##### `group` -Data type: `Any` +Data type: `String[1]` -Default value: 'www-data' +Default value: `'www-data'` -##### `workers` +##### `workers` -Data type: `Any` +Data type: `Variant[Boolean,Integer]` -Default value: `false` +Default value: ``false`` -##### `access_log_format` +##### `access_log_format` -Data type: `Any` +Data type: `Variant[Boolean,String[1]]` -Default value: `false` +Default value: ``false`` -##### `accesslog` +##### `accesslog` -Data type: `Any` +Data type: `Variant[Boolean,Stdlib::Absolutepath]` -Default value: `false` +Default value: ``false`` -##### `errorlog` +##### `errorlog` -Data type: `Any` +Data type: `Variant[Boolean,Stdlib::Absolutepath]` -Default value: `false` +Default value: ``false`` -##### `log_level` +##### `log_level` -Data type: `Enum['debug', 'info', 'warning', 'error', 'critical']` +Data type: `Python::Loglevel` -Default value: 'error' +Default value: `'error'` -### python::pip +### `python::pip` Installs and manages packages from pip. @@ -567,7 +628,7 @@ virtualenv => '/var/www/project1', owner => 'appuser', proxy => 'http://proxy.domain.com:3128', - environment => 'ORACLE_HOME=/usr/lib/oracle/11.2/client64', + environment => ['ORACLE_HOME=/usr/lib/oracle/11.2/client64'], install_args => '-e', timeout => 1800, } @@ -588,165 +649,195 @@ #### Parameters -The following parameters are available in the `python::pip` defined type. +The following parameters are available in the `python::pip` defined type: -##### `name` +* [`name`](#name) +* [`pkgname`](#pkgname) +* [`ensure`](#ensure) +* [`virtualenv`](#virtualenv) +* [`pip_provider`](#pip_provider) +* [`url`](#url) +* [`owner`](#owner) +* [`group`](#group) +* [`index`](#index) +* [`proxy`](#proxy) +* [`editable`](#editable) +* [`environment`](#environment) +* [`extras`](#extras) +* [`timeout`](#timeout) +* [`install_args`](#install_args) +* [`uninstall_args`](#uninstall_args) +* [`log_dir`](#log_dir) +* [`egg`](#egg) +* [`umask`](#umask) +* [`path`](#path) +* [`exec_provider`](#exec_provider) + +##### `name` must be unique -##### `pkgname` +##### `pkgname` -Data type: `String` +Data type: `String[1]` the name of the package. -Default value: $name +Default value: `$name` -##### `ensure` +##### `ensure` Data type: `Variant[Enum[present, absent, latest], String[1]]` Require pip to be available. -Default value: present +Default value: `present` -##### `virtualenv` +##### `virtualenv` Data type: `Variant[Enum['system'], Stdlib::Absolutepath]` virtualenv to run pip in. -Default value: 'system' +Default value: `'system'` -##### `pip_provider` +##### `pip_provider` Data type: `String[1]` version of pip you wish to use. -Default value: 'pip' +Default value: `'pip'` -##### `url` +##### `url` Data type: `Variant[Boolean, String]` URL to install from. -Default value: `false` +Default value: ``false`` -##### `owner` +##### `owner` Data type: `String[1]` The owner of the virtualenv being manipulated. -Default value: 'root' +Default value: `'root'` -##### `group` +##### `group` -Data type: `Any` +Data type: `Optional[String[1]]` The group of the virtualenv being manipulated. -Default value: getvar('python::params::group') +Default value: `getvar('python::params::group')` -##### `index` +##### `index` -Data type: `Any` +Data type: `Variant[Boolean,String[1]]` Base URL of Python package index. -Default value: `false` +Default value: ``false`` -##### `proxy` +##### `proxy` Data type: `Optional[Stdlib::HTTPUrl]` Proxy server to use for outbound connections. -Default value: `undef` +Default value: ``undef`` -##### `editable` +##### `editable` Data type: `Boolean` If true the package is installed as an editable resource. -Default value: `false` +Default value: ``false`` -##### `environment` +##### `environment` -Data type: `Any` +Data type: `Array` Additional environment variables required to install the packages. -Default value: [] +Default value: `[]` -##### `extras` +##### `extras` -Data type: `Any` +Data type: `Array` Extra features provided by the package which should be installed. -Default value: [] +Default value: `[]` -##### `timeout` +##### `timeout` Data type: `Numeric` The maximum time in seconds the "pip install" command should take. -Default value: 1800 +Default value: `1800` -##### `install_args` +##### `install_args` -Data type: `String` +Data type: `Optional[String[1]]` Any additional installation arguments that will be supplied when running pip install. -Default value: '' +Default value: ``undef`` -##### `uninstall_args` +##### `uninstall_args` -Data type: `String` +Data type: `Optional[String[1]]` Any additional arguments that will be supplied when running pip uninstall. -Default value: '' +Default value: ``undef`` -##### `log_dir` +##### `log_dir` Data type: `String[1]` Log directory -Default value: '/tmp' +Default value: `'/tmp'` -##### `egg` +##### `egg` Data type: `Any` The egg name to use -Default value: `false` +Default value: ``false`` -##### `umask` +##### `umask` -Data type: `Any` +Data type: `Optional[Python::Umask]` -Default value: `undef` +Default value: ``undef`` -##### `path` +##### `path` Data type: `Array[String]` -Default value: ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'] +Default value: `['/usr/local/bin','/usr/bin','/bin', '/usr/sbin']` + +##### `exec_provider` + +Data type: `String[1]` -### python::pyvenv + + +Default value: `'shell'` + +### `python::pyvenv` Create a Python3 virtualenv using pyvenv. @@ -767,81 +858,100 @@ #### Parameters -The following parameters are available in the `python::pyvenv` defined type. +The following parameters are available in the `python::pyvenv` defined type: -##### `ensure` +* [`ensure`](#ensure) +* [`version`](#version) +* [`systempkgs`](#systempkgs) +* [`venv_dir`](#venv_dir) +* [`owner`](#owner) +* [`group`](#group) +* [`mode`](#mode) +* [`path`](#path) +* [`environment`](#environment) +* [`pip_version`](#pip_version) -Data type: `Any` +##### `ensure` + +Data type: `Python::Package::Ensure` -Default value: present +Default value: `present` -##### `version` +##### `version` -Data type: `Any` +Data type: `Python::Version` Python version to use. -Default value: 'system' +Default value: `'system'` -##### `systempkgs` +##### `systempkgs` -Data type: `Any` +Data type: `Boolean` Copy system site-packages into virtualenv -Default value: `false` +Default value: ``false`` -##### `venv_dir` +##### `venv_dir` -Data type: `Any` +Data type: `Stdlib::Absolutepath` Directory to install virtualenv to -Default value: $name +Default value: `$name` -##### `owner` +##### `owner` -Data type: `Any` +Data type: `String[1]` The owner of the virtualenv being manipulated -Default value: 'root' +Default value: `'root'` -##### `group` +##### `group` -Data type: `Any` +Data type: `String[1]` The group relating to the virtualenv being manipulated -Default value: 'root' +Default value: `'root'` -##### `mode` +##### `mode` -Data type: `Any` +Data type: `Stdlib::Filemode` Optionally specify directory mode -Default value: '0755' +Default value: `'0755'` -##### `path` +##### `path` -Data type: `Any` +Data type: `Array[Stdlib::Absolutepath]` Specifies the PATH variable. -Default value: [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ] +Default value: `['/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin',]` -##### `environment` +##### `environment` -Data type: `Any` +Data type: `Array` Optionally specify environment variables for pyvenv -Default value: [] +Default value: `[]` + +##### `pip_version` + +Data type: `Python::Venv::PipVersion` -### python::requirements + + +Default value: `'latest'` + +### `python::requirements` Installs and manages Python packages from requirements file. @@ -860,300 +970,203 @@ #### Parameters -The following parameters are available in the `python::requirements` defined type. +The following parameters are available in the `python::requirements` defined type: -##### `requirements` +* [`requirements`](#requirements) +* [`virtualenv`](#virtualenv) +* [`pip_provider`](#pip_provider) +* [`owner`](#owner) +* [`group`](#group) +* [`proxy`](#proxy) +* [`src`](#src) +* [`environment`](#environment) +* [`forceupdate`](#forceupdate) +* [`cwd`](#cwd) +* [`extra_pip_args`](#extra_pip_args) +* [`manage_requirements`](#manage_requirements) +* [`fix_requirements_owner`](#fix_requirements_owner) +* [`log_dir`](#log_dir) +* [`timeout`](#timeout) -Data type: `Any` +##### `requirements` + +Data type: `Stdlib::Absolutepath` Path to the requirements file. -Default value: $name +Default value: `$name` -##### `virtualenv` +##### `virtualenv` -Data type: `Any` +Data type: `Variant[Enum['system'],Stdlib::Absolutepath]` virtualenv to run pip in. -Default value: 'system' +Default value: `'system'` -##### `pip_provider` +##### `pip_provider` Data type: `Enum['pip', 'pip3']` version of pip you wish to use. -Default value: 'pip' +Default value: `'pip'` -##### `owner` +##### `owner` -Data type: `Any` +Data type: `String[1]` The owner of the virtualenv being manipulated. -Default value: 'root' +Default value: `'root'` -##### `group` +##### `group` -Data type: `Any` +Data type: `String[1]` The group relating to the virtualenv being manipulated. -Default value: 'root' +Default value: `'root'` -##### `proxy` +##### `proxy` Data type: `Optional[Stdlib::HTTPUrl]` Proxy server to use for outbound connections. -Default value: `undef` +Default value: ``undef`` -##### `src` +##### `src` Data type: `Any` Pip --src parameter to; if the requirements file contains --editable resources, this parameter specifies where they will be installed. See the pip documentation for more. -Default value: `false` +Default value: ``false`` -##### `environment` +##### `environment` -Data type: `Any` +Data type: `Array` Additional environment variables required to install the packages. -Default value: [] +Default value: `[]` -##### `forceupdate` +##### `forceupdate` -Data type: `Any` +Data type: `Boolean` Run a pip install requirements even if we don't receive an event from the requirements file - Useful for when the requirements file is written as part of a resource other than file (E.g vcsrepo) -Default value: `false` +Default value: ``false`` -##### `cwd` +##### `cwd` -Data type: `Any` +Data type: `Optional[Stdlib::Absolutepath]` The directory from which to run the "pip install" command. -Default value: `undef` +Default value: ``undef`` -##### `extra_pip_args` +##### `extra_pip_args` -Data type: `Any` +Data type: `Optional[String[1]]` Extra arguments to pass to pip after the requirements file -Default value: '' +Default value: ``undef`` -##### `manage_requirements` +##### `manage_requirements` -Data type: `Any` +Data type: `Boolean` Create the requirements file if it doesn't exist. -Default value: `true` +Default value: ``true`` -##### `fix_requirements_owner` +##### `fix_requirements_owner` -Data type: `Any` +Data type: `Boolean` Change owner and group of requirements file. -Default value: `true` +Default value: ``true`` -##### `log_dir` +##### `log_dir` -Data type: `Any` +Data type: `Stdlib::Absolutepath` Log directory. -Default value: '/tmp' +Default value: `'/tmp'` -##### `timeout` +##### `timeout` -Data type: `Any` +Data type: `Integer` The maximum time in seconds the "pip install" command should take. -Default value: 1800 +Default value: `1800` -### python::virtualenv +## Data types -Creates Python virtualenv. +### `Python::Loglevel` -#### Examples +A version type to match all valid loglevels for python -##### install a virtual env at /var/www/project1 +Alias of ```puppet -python::virtualenv { '/var/www/project1': - ensure => present, - version => 'system', - requirements => '/var/www/project1/requirements.txt', - proxy => 'http://proxy.domain.com:3128', - systempkgs => true, - index => 'http://www.example.com/simple/', -} +Enum['debug', 'info', 'warning', 'error', 'critical'] +``` + +### `Python::Package::Ensure` + +A version type to match all valid package ensures for python + +Alias of + +```puppet +Enum['absent', 'present', 'latest'] ``` -#### Parameters - -The following parameters are available in the `python::virtualenv` defined type. - -##### `ensure` - -Data type: `Any` - +### `Python::Provider` - -Default value: 'present' - -##### `version` - -Data type: `Any` - -Python version to use. +A version type to match all valid provider for python -Default value: 'system' - -##### `requirements` - -Data type: `Any` - -Path to pip requirements.txt file - -Default value: `false` +Alias of -##### `systempkgs` - -Data type: `Any` - -Copy system site-packages into virtualenv. - -Default value: `false` - -##### `venv_dir` +```puppet +Enum['pip', 'scl', 'rhscl', 'anaconda', ''] +``` -Data type: `Any` - -Directory to install virtualenv to - -Default value: $name - -##### `ensure_venv_dir` - -Data type: `Any` +### `Python::Umask` -Create $venv_dir - -Default value: `true` - -##### `distribute` - -Data type: `Any` - -Include distribute in the virtualenv +A version type to match valid umask for python -Default value: `true` - -##### `index` - -Data type: `Any` - -Base URL of Python package index - -Default value: `false` +Alias of -##### `owner` - -Data type: `Any` - -The owner of the virtualenv being manipulated - -Default value: 'root' - -##### `group` +```puppet +Pattern[/[0-7]{1,4}/] +``` -Data type: `Any` - -The group relating to the virtualenv being manipulated - -Default value: 'root' - -##### `mode` +### `Python::Venv::PipVersion` -Data type: `Any` - -Optionally specify directory mode - -Default value: '0755' - -##### `proxy` - -Data type: `Optional[Stdlib::HTTPUrl]` +A version type to ensure a specific Pip version in a virtual env. -Proxy server to use for outbound connections - -Default value: `undef` - -##### `environment` - -Data type: `Any` - -Additional environment variables required to install the packages +Alias of -Default value: [] - -##### `path` - -Data type: `Any` - -Specifies the PATH variable - -Default value: [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ] +```puppet +Pattern[/^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, /\Alatest\Z/] +``` -##### `cwd` - -Data type: `Any` - -The directory from which to run the "pip install" command - -Default value: `undef` - -##### `timeout` +### `Python::Version` -Data type: `Any` - -The maximum time in seconds the "pip install" command should take - -Default value: 1800 - -##### `pip_args` - -Data type: `Any` +A version type to match all valid versions for python -Arguments to pass to pip during initialization - -Default value: '' - -##### `extra_pip_args` - -Data type: `Any` - -Extra arguments to pass to pip after requirements file +Alias of -Default value: '' - -##### `virtualenv` +```puppet +Pattern[/\A(python)?[0-9](\.?[0-9])*/, /\Apypy\Z/, /\Asystem\Z/, /\Arh-python[0-9]{2}(?:-python)?\Z/] +``` -Data type: `Any` - - - -Default value: `undef` - diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/Rakefile --- a/modules/python/Rakefile Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ -require 'puppetlabs_spec_helper/rake_tasks' - -# load optional tasks for releases -# only available if gem group releases is installed -begin - require 'voxpupuli/release/rake_tasks' -rescue LoadError -end - -PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}' -PuppetLint.configuration.absolute_classname_reverse = true - -exclude_paths = %w( - pkg/**/* - vendor/**/* - .vendor/**/* - spec/**/* -) -PuppetLint.configuration.ignore_paths = exclude_paths -PuppetSyntax.exclude_paths = exclude_paths - -desc 'Auto-correct puppet-lint offenses' -task 'lint:auto_correct' do - Rake::Task[:lint_fix].invoke -end - -desc 'Run acceptance tests' -RSpec::Core::RakeTask.new(:acceptance) do |t| - t.pattern = 'spec/acceptance' -end - -desc 'Run tests' -task test: [:release_checks] - -namespace :check do - desc 'Check for trailing whitespace' - task :trailing_whitespace do - Dir.glob('**/*.md', File::FNM_DOTMATCH).sort.each do |filename| - next if filename =~ %r{^((modules|acceptance|\.?vendor|spec/fixtures|pkg)/|REFERENCE.md)} - File.foreach(filename).each_with_index do |line, index| - if line =~ %r{\s\n$} - puts "#{filename} has trailing whitespace on line #{index + 1}" - exit 1 - end - end - end - end -end -Rake::Task[:release_checks].enhance ['check:trailing_whitespace'] - -desc "Run main 'test' task and report merged results to coveralls" -task test_with_coveralls: [:test] do - if Dir.exist?(File.expand_path('../lib', __FILE__)) - require 'coveralls/rake/task' - Coveralls::RakeTask.new - Rake::Task['coveralls:push'].invoke - else - puts 'Skipping reporting to coveralls. Module has no lib dir' - end -end - -desc 'Generate REFERENCE.md' -task :reference, [:debug, :backtrace] do |t, args| - patterns = '' - Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace]) -end - -begin - require 'github_changelog_generator/task' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - version = (Blacksmith::Modulefile.new).version - config.future_release = "v#{version}" if version =~ /^\d+\.\d+.\d+$/ - config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module." - config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog} - config.user = 'voxpupuli' - metadata_json = File.join(File.dirname(__FILE__), 'metadata.json') - metadata = JSON.load(File.read(metadata_json)) - config.project = metadata['name'] - end - - # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715 - require 'rbconfig' - if RbConfig::CONFIG['host_os'] =~ /linux/ - task :changelog do - puts 'Fixing line endings...' - changelog_file = File.join(__dir__, 'CHANGELOG.md') - changelog_txt = File.read(changelog_file) - new_contents = changelog_txt.gsub(%r{\r\n}, "\n") - File.open(changelog_file, "w") {|file| file.puts new_contents } - end - end - -rescue LoadError -end -# vim: syntax=ruby diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/checksums.json --- a/modules/python/checksums.json Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -{ - "CHANGELOG.md": "0cab76c8f9793932b92fda2d50f4a23e", - "Gemfile": "84e2c282bbc05ef70ef72bbecca26848", - "LICENSE": "cf2903831f7e18e82a84cce52f44e4a8", - "README.md": "3d3787faa78ce3339ec2e40e50cba86d", - "REFERENCE.md": "8fa2302aa0ed90cfc8ec6a59610f9327", - "Rakefile": "063ce145516a70f50c70507ec2cf8485", - "examples/gunicorn.pp": "32bb19ae1f97d8cba83cf38b6f57e4af", - "examples/init.pp": "251c210b05aab1f84c49a38f7fe48bbe", - "examples/pip.pp": "e3a793d4c714c39df31f3f79f0d7629c", - "examples/pyvenv.pp": "670893796f6ae5d413297f53619f31f4", - "examples/requirements.pp": "4a5e714fbbd623e519f0c07914367730", - "examples/virtualenv.pp": "698f811b9110cbc5d9262f0500bd7ee4", - "lib/facter/pip_version.rb": "22ec959de3b32e8c84bfafef55fda93b", - "lib/facter/python_release.rb": "538f2dd1fa07398d52ad5a50387bdaef", - "lib/facter/python_version.rb": "081bcac6e43288adf4327ce5d10ddc24", - "lib/facter/virtualenv_version.rb": "9e8018fd1147293617f800c39b19131b", - "manifests/config.pp": "cd2e0384d066fb0315b704d3206c151d", - "manifests/dotfile.pp": "2073618bebaab016fae9dc83b254ae92", - "manifests/gunicorn.pp": "4f9e3bfe50911e5ce654d299703e2516", - "manifests/init.pp": "69ab1b5a45813c2e4a2dfddb5a7e48c4", - "manifests/install.pp": "e973644a1cf889f499a7fee967970f2f", - "manifests/params.pp": "b95332cce50a384454484927d209cb56", - "manifests/pip/bootstrap.pp": "dc1333af9efdc55c297d81ae67ec181d", - "manifests/pip.pp": "6873b38335786cd2c040ca310596f6de", - "manifests/pyvenv.pp": "2d73296d6dc7d447ce24bfab1c2703da", - "manifests/requirements.pp": "d81c6a667c514a9760a7444cb9438b6a", - "manifests/virtualenv.pp": "78fa93cf6b4c43644772554012049f37", - "metadata.json": "5dcc8aa2edfd5a22c3f534130c9b448b", - "spec/acceptance/class_spec.rb": "8e4c8db084868f05458695034ddd3866", - "spec/acceptance/facts_test_spec.rb": "da437f4f9427faa7a655110f8971b057", - "spec/acceptance/nodesets/archlinux-2-x64.yml": "daafcfcb4c8c8766856f52cec6ae5e86", - "spec/acceptance/nodesets/centos-59-x64.yml": "57eb3e471b9042a8ea40978c467f8151", - "spec/acceptance/nodesets/centos-64-x64-pe.yml": "ec075d95760df3d4702abea1ce0a829b", - "spec/acceptance/nodesets/centos-65-x64.yml": "3e5c36e6aa5a690229e720f4048bb8af", - "spec/acceptance/nodesets/debian-70rc1-x64.yml": "715f798e696d3582c66d13f0e8e5f009", - "spec/acceptance/nodesets/debian-73-x64.yml": "b44b7146a828c37482c06879862fb5d9", - "spec/acceptance/nodesets/default.yml": "e27bb4d7526ad3c7a1c4aeb87decec15", - "spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml": "b3dc2d81918fcc6d56855c88ba5b7ce8", - "spec/acceptance/nodesets/ec2/image_templates.yaml": "516f9c4c3407993a100090ce9e1a643c", - "spec/acceptance/nodesets/ec2/rhel-73-x64.yml": "e74670a1cb8eea32afc879a5d786f9bd", - "spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml": "2506efcc9fb420132edc37bf88d6e21d", - "spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml": "87efd97ff1b073c3448f429a8ffc5a7c", - "spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml": "e9db4dd16c60c52b433694130c2583a0", - "spec/acceptance/nodesets/ubuntu-server-10044-x64.yml": "75e86400b7889888dc0781c0ae1a1297", - "spec/acceptance/nodesets/ubuntu-server-12042-x64.yml": "d30d73e34cd50b043c7d14e305955269", - "spec/acceptance/virtualenv_spec.rb": "c36b87305103217509c3267d4e523a85", - "spec/classes/python_spec.rb": "284bf28bf101ba3749321af0f987cce2", - "spec/default_module_facts.yml": "70b23a7fac504eb45eee3381d690e626", - "spec/defines/dotfile_spec.rb": "a6e033fcf12c1ebee9a8b4718757b158", - "spec/defines/gunicorn_spec.rb": "f908ecdbb7693bda4c039d33fa6d6fa6", - "spec/defines/pip_spec.rb": "d3c8a04b6ef012ff80575f3c6425fd43", - "spec/defines/pyvenv_spec.rb": "5416e9759ca93e47ca86d0c8156f874a", - "spec/defines/requirements_spec.rb": "ca9410d7a3ad790ccfaf9814b6208a86", - "spec/spec.opts": "a600ded995d948e393fbe2320ba8e51c", - "spec/spec_helper.rb": "366b23c0f531ca4e9ffa2ca99f49aeee", - "spec/spec_helper_acceptance.rb": "fd73548c50d34f58c27bc7965b2ba2fb", - "spec/unit/facter/pip_version_spec.rb": "954c97a38bcc9a528d1439ad7052af4b", - "spec/unit/facter/python_release_spec.rb": "3e2a59254654a97ff1b082aed4b517a7", - "spec/unit/facter/python_version_spec.rb": "69bed281bfed98cf9ab32a39e40372b6", - "spec/unit/facter/virtualenv_version_spec.rb": "705557a6b9d686481bbec197cb3e2bae", - "templates/gunicorn.erb": "7d1a6b3340dbdad069e0bdfb14255271", - "templates/inifile.erb": "ce9b0646bd1bcf91a2be0997d44c917f" -} \ No newline at end of file diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/lib/facter/pip_version.rb --- a/modules/python/lib/facter/pip_version.rb Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/lib/facter/pip_version.rb Mon Jan 03 17:13:06 2022 +0000 @@ -1,9 +1,28 @@ +# frozen_string_literal: true + # 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 diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/lib/facter/python_release.rb --- a/modules/python/lib/facter/python_release.rb Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/lib/facter/python_release.rb Mon Jan 03 17:13:06 2022 +0000 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Make python release available as facts def get_python_release(executable) diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/lib/facter/python_version.rb --- a/modules/python/lib/facter/python_version.rb Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/lib/facter/python_version.rb Mon Jan 03 17:13:06 2022 +0000 @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Make python versions available as facts def get_python_version(executable) diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/lib/facter/virtualenv_version.rb --- a/modules/python/lib/facter/virtualenv_version.rb Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/lib/facter/virtualenv_version.rb Mon Jan 03 17:13:06 2022 +0000 @@ -1,9 +1,12 @@ +# frozen_string_literal: true + # Make virtualenv version available as a fact 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*).*$})[0] + results = Facter::Util::Resolution.exec('virtualenv --version 2>&1').match(%r{(\d+\.\d+\.?\d*).*$}) + results[1] if results end end end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/config.pp --- a/modules/python/manifests/config.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/config.pp Mon Jan 03 17:13:06 2022 +0000 @@ -5,15 +5,11 @@ # include python::config # class python::config { - Class['python::install'] -> Python::Pip <| |> Class['python::install'] -> Python::Requirements <| |> - Class['python::install'] -> Python::Virtualenv <| |> - - Python::Virtualenv <| |> -> Python::Pip <| |> if $python::manage_gunicorn { - if $python::gunicorn != 'absent' { + unless $python::gunicorn == 'absent' { Class['python::install'] -> Python::Gunicorn <| |> Python::Gunicorn <| |> ~> Service['gunicorn'] @@ -27,5 +23,4 @@ } } } - } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/dotfile.pp --- a/modules/python/manifests/dotfile.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/dotfile.pp Mon Jan 03 17:13:06 2022 +0000 @@ -24,17 +24,17 @@ # define python::dotfile ( Enum['absent', 'present'] $ensure = 'present', - String[1] $filename = $title, - String[1] $owner = 'root', - String[1] $group = 'root', - Stdlib::Filemode $mode = '0644', - Hash $config = {}, + Stdlib::Absolutepath $filename = $title, + String[1] $owner = 'root', + String[1] $group = 'root', + Stdlib::Filemode $mode = '0644', + Hash $config = {}, ) { $parent_dir = dirname($filename) 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, } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/gunicorn.pp --- a/modules/python/manifests/gunicorn.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/gunicorn.pp Mon Jan 03 17:13:06 2022 +0000 @@ -34,26 +34,26 @@ # } # define python::gunicorn ( - Stdlib::Absolutepath $dir, - Enum['present', 'absent'] $ensure = present, - $config_dir = '/etc/gunicorn.d', - $manage_config_dir = false, - $virtualenv = false, - Enum['wsgi', 'django'] $mode = 'wsgi', - $bind = false, - $environment = false, - $owner = 'www-data', - $group = 'www-data', - $appmodule = 'app:app', - $osenv = false, - $timeout = 30, - $workers = false, - $access_log_format = false, - $accesslog = false, - $errorlog = false, - Enum['debug', 'info', 'warning', 'error', 'critical'] $log_level = 'error', - $template = 'python/gunicorn.erb', - $args = [], + Stdlib::Absolutepath $dir, + Enum['present', 'absent'] $ensure = present, + Stdlib::Absolutepath $config_dir = '/etc/gunicorn.d', + Boolean $manage_config_dir = false, + Variant[Boolean,Stdlib::Absolutepath] $virtualenv = false, + Enum['wsgi', 'django'] $mode = 'wsgi', + Variant[String[1],Boolean] $bind = false, + Variant[String[1],Boolean] $environment = false, + String[1] $owner = 'www-data', + String[1] $group = 'www-data', + String[1] $appmodule = 'app:app', + Variant[Boolean,Hash] $osenv = false, + Integer $timeout = 30, + Variant[Boolean,Integer] $workers = false, + Variant[Boolean,String[1]] $access_log_format = false, + Variant[Boolean,Stdlib::Absolutepath] $accesslog = false, + Variant[Boolean,Stdlib::Absolutepath] $errorlog = false, + Python::Loglevel $log_level = 'error', + String[1] $template = 'python/gunicorn.erb', + Array $args = [], ) { if $manage_config_dir { file { $config_dir: @@ -62,6 +62,7 @@ owner => 'root', group => 'root', } + file { "${config_dir}/${name}": ensure => $ensure, mode => '0644', @@ -79,5 +80,4 @@ content => template($template), } } - } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/init.pp --- a/modules/python/manifests/init.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/init.pp Mon Jan 03 17:13:06 2022 +0000 @@ -1,4 +1,4 @@ -# @summary Installs and manages python, python-dev, python-virtualenv and gunicorn. +# @summary Installs and manages python, python-dev and gunicorn. # # @param ensure Desired installation state for the Python package. # @param version Python version to install. Beware that valid values for this differ a) by the provider you choose and b) by the osfamily/operatingsystem you are using. @@ -11,7 +11,6 @@ # package, if available on your osfamily. # @param pip Desired installation state for the python-pip package. # @param dev Desired installation state for the python-dev package. -# @param virtualenv Desired installation state for the virtualenv package # @param gunicorn Desired installation state for Gunicorn. # @param manage_gunicorn Allow Installation / Removal of Gunicorn. # @param provider What provider to use for installation of the packages, except gunicorn and Python itself. @@ -24,7 +23,6 @@ # version => 'system', # pip => 'present', # dev => 'present', -# virtualenv => 'present', # gunicorn => 'present', # } # @example install python3 from scl repo @@ -32,50 +30,36 @@ # ensure => 'present', # version => 'rh-python36-python', # dev => 'present', -# virtualenv => 'present', # } # class python ( - Enum['absent', 'present', 'latest'] $ensure = $python::params::ensure, - $version = $python::params::version, - Enum['absent', 'present', 'latest'] $pip = $python::params::pip, - Enum['absent', 'present', 'latest'] $dev = $python::params::dev, - Enum['absent', 'present', 'latest'] $virtualenv = $python::params::virtualenv, - Enum['absent', 'present', 'latest'] $gunicorn = $python::params::gunicorn, - Boolean $manage_gunicorn = $python::params::manage_gunicorn, - $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 = { }, - 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, + Python::Package::Ensure $ensure = $python::params::ensure, + Python::Version $version = '3', + Python::Package::Ensure $pip = $python::params::pip, + Python::Package::Ensure $dev = $python::params::dev, + Python::Package::Ensure $gunicorn = $python::params::gunicorn, + Boolean $manage_gunicorn = $python::params::manage_gunicorn, + Boolean $manage_python_package = $python::params::manage_python_package, + Boolean $manage_pip_package = $python::params::manage_pip_package, + String[1] $gunicorn_package_name = $python::params::gunicorn_package_name, + Optional[Python::Provider] $provider = $python::params::provider, + Hash $python_pips = {}, + Hash $python_pyvenvs = {}, + Hash $python_requirements = {}, + Hash $python_dotfiles = {}, + Boolean $use_epel = $python::params::use_epel, + Boolean $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[Python::Umask] $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/] { - 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' ] - if ! ($facts['os']['family'] in $compatible) { - fail("Module is not compatible with ${facts['os']['name']}") - } - contain python::install contain python::config @@ -83,15 +67,13 @@ -> Class['python::config'] # Set default umask. - if $umask != undef { - Exec { umask => $umask } + exec { default: + umask => $umask, } # Allow hiera configuration of python resources create_resources('python::pip', $python_pips) create_resources('python::pyvenv', $python_pyvenvs) - create_resources('python::virtualenv', $python_virtualenvs) create_resources('python::requirements', $python_requirements) create_resources('python::dotfile', $python_dotfiles) - } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/install.pp --- a/modules/python/manifests/install.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/install.pp Mon Jan 03 17:13:06 2022 +0000 @@ -5,7 +5,6 @@ # include python::install # class python::install { - $python = $python::version ? { 'system' => 'python', 'pypy' => 'pypy', @@ -16,11 +15,12 @@ } $pythondev = $facts['os']['family'] ? { - 'AIX' => "${python}-devel", - 'RedHat' => "${python}-devel", - 'Debian' => "${python}-dev", - 'Suse' => "${python}-devel", - 'Gentoo' => undef, + 'AIX' => "${python}-devel", + 'Debian' => "${python}-dev", + 'FreeBSD' => undef, + 'Gentoo' => undef, + 'RedHat' => "${python}-devel", + 'Suse' => "${python}-devel", } $pip_ensure = $python::pip ? { @@ -29,44 +29,26 @@ default => $python::pip, } - $venv_ensure = $python::virtualenv ? { + $dev_ensure = $python::dev ? { true => 'present', false => 'absent', - default => $python::virtualenv, + default => $python::dev, } - if $venv_ensure == 'present' { - $dev_ensure = 'present' - unless $python::dev { - # Error: python2-devel is needed by (installed) python-virtualenv-15.1.0-2.el7.noarch - # Python dev is required for virtual environment, but python environment is not required for python dev. - notify { 'Python virtual environment is dependent on python dev': } + if $python::manage_python_package { + package { 'python': + ensure => $python::ensure, + name => $python, } - } else { - $dev_ensure = $python::dev ? { - true => 'present', - false => 'absent', - default => $python::dev, - } - } - - package { 'python': - ensure => $python::ensure, - name => $python, - } - - package { 'virtualenv': - ensure => $venv_ensure, - name => "${python}-virtualenv", - require => Package['python'], } case $python::provider { 'pip': { - - package { 'pip': - ensure => $pip_ensure, - require => Package['python'], + if $python::manage_pip_package { + package { 'pip': + ensure => $pip_ensure, + require => Package['python'], + } } if $pythondev { @@ -79,7 +61,7 @@ # Respect the $pip_ensure setting unless $pip_ensure == 'absent' { # Install pip without pip, see https://pip.pypa.io/en/stable/installing/. - include 'python::pip::bootstrap' + include python::pip::bootstrap Exec['bootstrap pip'] -> File['pip-python'] -> Package <| provider == pip |> @@ -87,18 +69,6 @@ name => 'pip', provider => 'pip', } - if $pythondev { - Package <| title == 'virtualenv' |> { - name => 'virtualenv', - provider => 'pip', - require => Package['python-dev'], - } - } else { - Package <| title == 'virtualenv' |> { - name => 'virtualenv', - provider => 'pip', - } - } } } 'scl': { @@ -115,6 +85,7 @@ ensure => $install_scl_repo_package, before => Package['scl-utils'], } + package { 'scl-utils': ensure => 'present', before => Package['python'], @@ -127,14 +98,10 @@ } } - # This gets installed as a dependency anyway - # package { "${python::version}-python-virtualenv": - # ensure => $venv_ensure, - # require => Package['scl-utils'], - # } package { "${python}-scldevel": ensure => $dev_ensure, } + if $pip_ensure != 'absent' { exec { 'python-scl-pip-install': command => "${python::exec_prefix}easy_install pip", @@ -147,6 +114,7 @@ # rhscl is RedHat SCLs from softwarecollections.org if $python::rhscl_use_public_repository { $scl_package = "rhscl-${python::version}-epel-${facts['os']['release']['major']}-${facts['os']['architecture']}" + package { $scl_package: source => "https://www.softwarecollections.org/en/scls/rhscl/${python::version}/epel-${facts['os']['release']['major']}-${facts['os']['architecture']}/download/${scl_package}.noarch.rpm", provider => 'rpm', @@ -177,8 +145,7 @@ -> Package <| tag == 'python-scl-package' |> } - Package <| tag == 'python-scl-package' |> - -> Package <| tag == 'python-pip-package' |> + Package <| tag == 'python-scl-package' |> -> Package <| tag == 'python-pip-package' |> } 'anaconda': { $installer_path = '/var/tmp/anaconda_installer.sh' @@ -202,15 +169,18 @@ 'AIX': { if String($python::version) =~ /^python3/ { class { 'python::pip::bootstrap': - version => 'pip3', + version => 'pip3', } } else { - package { 'python-pip': - ensure => $pip_ensure, - require => Package['python'], - provider => 'yum', + if $python::manage_pip_package { + package { 'python-pip': + ensure => $pip_ensure, + require => Package['python'], + provider => 'yum', + } } } + if $pythondev { package { 'python-dev': ensure => $dev_ensure, @@ -219,13 +189,15 @@ provider => 'yum', } } - } default: { - package { 'pip': - ensure => $pip_ensure, - require => Package['python'], + if $python::manage_pip_package { + package { 'pip': + ensure => $pip_ensure, + require => Package['python'], + } } + if $pythondev { package { 'python-dev': ensure => $dev_ensure, @@ -233,57 +205,46 @@ alias => $pythondev, } } - } } - case $facts['os']['family'] { - 'RedHat': { - if $pip_ensure != 'absent' { - if $python::use_epel == true { - include 'epel' - Class['epel'] -> Package['pip'] - } - } - if ($venv_ensure != 'absent') and ($facts['os']['release']['full'] =~ /^6/) { - if $python::use_epel == true { - include 'epel' - Class['epel'] -> Package['virtualenv'] - } - } - - $virtualenv_package = "${python}-virtualenv" - } - 'Debian': { - if fact('lsbdistcodename') == 'trusty' { - $virtualenv_package = 'python-virtualenv' - } else { - $virtualenv_package = 'virtualenv' - } - } - 'Gentoo': { - $virtualenv_package = 'virtualenv' - } - default: { - $virtualenv_package = 'python-virtualenv' + if $facts['os']['family'] == 'RedHat' { + if $pip_ensure != 'absent' and $python::use_epel and ($python::manage_pip_package or $python::manage_python_package) { + require epel } } if String($python::version) =~ /^python3/ { $pip_category = undef - $pip_package = "${python}-pip" + $pip_package = "${python}-pip" $pip_provider = $python.regsubst(/^.*python3\.?/,'pip3.').regsubst(/\.$/,'') + } elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '8') >= 0) { + $pip_category = undef + $pip_package = 'python3-pip' + $pip_provider = pip3 } elsif ($facts['os']['family'] == 'RedHat') and (versioncmp($facts['os']['release']['major'], '7') >= 0) { $pip_category = undef - $pip_package = 'python2-pip' + $pip_package = 'python2-pip' $pip_provider = pip2 + } elsif $facts['os']['family'] == 'FreeBSD' { + $pip_category = undef + $pip_package = "py${python::version}-pip" + $pip_provider = 'pip' } elsif $facts['os']['family'] == 'Gentoo' { $pip_category = 'dev-python' - $pip_package = 'pip' + $pip_package = 'pip' $pip_provider = 'pip' + } elsif ($facts['os']['name'] == 'Ubuntu') and (versioncmp($facts['os']['release']['major'], '20.04') >= 0) { + $pip_category = undef + $pip_package = 'python3-pip' + $pip_provider = 'pip3' + } elsif ($facts['os']['name'] == 'Debian') and (versioncmp($facts['os']['release']['major'], '11') >= 0) { + $pip_category = undef + $pip_package = 'python3-pip' + $pip_provider = 'pip3' } else { $pip_category = undef - $pip_package = 'python-pip' + $pip_package = 'python-pip' $pip_provider = 'pip' } @@ -291,14 +252,6 @@ name => $pip_package, category => $pip_category, } - - Python::Pip <| |> { - pip_provider => $pip_provider, - } - - Package <| title == 'virtualenv' |> { - name => $virtualenv_package, - } } } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/params.pp --- a/modules/python/manifests/params.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/params.pp Mon Jan 03 17:13:06 2022 +0000 @@ -4,25 +4,31 @@ # The python Module default configuration settings. # class python::params { - $ensure = 'present' - $version = 'system' - $pip = 'present' - $dev = 'absent' - $virtualenv = 'absent' - $gunicorn = 'absent' - $manage_gunicorn = true - $provider = undef - $valid_versions = undef - $manage_scl = true + # Module compatibility check + unless $facts['os']['family'] in ['AIX', 'Debian', 'FreeBSD', 'Gentoo', 'RedHat', 'Suse'] { + fail("Module is not compatible with ${facts['os']['name']}") + } - if $facts['os']['family'] == 'RedHat' { - if $facts['os']['name'] != 'Fedora' { - $use_epel = true - } else { - $use_epel = false - } + $ensure = 'present' + $pip = 'present' + $dev = 'absent' + $virtualenv = 'absent' + $gunicorn = 'absent' + $manage_gunicorn = true + $manage_python_package = true + $manage_virtualenv_package = true + $manage_pip_package = true + $provider = undef + $valid_versions = undef + $manage_scl = true + $rhscl_use_public_repository = true + $anaconda_installer_url = 'https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh' + $anaconda_install_path = '/opt/python' + + if $facts['os']['family'] == 'RedHat' and $facts['os']['name'] != 'Fedora' { + $use_epel = true } else { - $use_epel = false + $use_epel = false } $group = $facts['os']['family'] ? { @@ -31,17 +37,15 @@ } $pip_lookup_path = $facts['os']['family'] ? { - 'AIX' => [ '/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/' ], - default => [ '/bin', '/usr/bin', '/usr/local/bin' ] + 'AIX' => ['/bin', '/usr/bin', '/usr/local/bin', '/opt/freeware/bin/',], + default => ['/bin', '/usr/bin', '/usr/local/bin',] } $gunicorn_package_name = $facts['os']['family'] ? { - 'RedHat' => 'python-gunicorn', + 'RedHat' => $facts['os']['release']['major'] ? { + '8' => 'python3-gunicorn', + default => 'python-gunicorn', + }, default => 'gunicorn', } - - $rhscl_use_public_repository = true - - $anaconda_installer_url = 'https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh' - $anaconda_install_path = '/opt/python' } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/pip.pp --- a/modules/python/manifests/pip.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/pip.pp Mon Jan 03 17:13:06 2022 +0000 @@ -33,7 +33,7 @@ # virtualenv => '/var/www/project1', # owner => 'appuser', # proxy => 'http://proxy.domain.com:3128', -# environment => 'ORACLE_HOME=/usr/lib/oracle/11.2/client64', +# environment => ['ORACLE_HOME=/usr/lib/oracle/11.2/client64'], # install_args => '-e', # timeout => 1800, # } @@ -48,33 +48,32 @@ # } # define python::pip ( - String $pkgname = $name, - Variant[Enum[present, absent, latest], String[1]] $ensure = present, - Variant[Enum['system'], Stdlib::Absolutepath] $virtualenv = 'system', - String[1] $pip_provider = 'pip', - Variant[Boolean, String] $url = false, - String[1] $owner = 'root', - $group = getvar('python::params::group'), - $umask = undef, - $index = false, - Optional[Stdlib::HTTPUrl] $proxy = undef, - $egg = false, - Boolean $editable = false, - $environment = [], - $extras = [], - String $install_args = '', - String $uninstall_args = '', - Numeric $timeout = 1800, - String[1] $log_dir = '/tmp', - Array[String] $path = ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], - String[1] $exec_provider = 'shell', -){ + String[1] $pkgname = $name, + Variant[Enum[present, absent, latest], String[1]] $ensure = present, + Variant[Enum['system'], Stdlib::Absolutepath] $virtualenv = 'system', + String[1] $pip_provider = 'pip', + Variant[Boolean, String] $url = false, + String[1] $owner = 'root', + Optional[String[1]] $group = getvar('python::params::group'), + Optional[Python::Umask] $umask = undef, + Variant[Boolean,String[1]] $index = false, + Optional[Stdlib::HTTPUrl] $proxy = undef, + Any $egg = false, + Boolean $editable = false, + Array $environment = [], + Array $extras = [], + Optional[String[1]] $install_args = undef, + Optional[String[1]] $uninstall_args = undef, + Numeric $timeout = 1800, + String[1] $log_dir = '/tmp', + Array[String] $path = ['/usr/local/bin','/usr/bin','/bin', '/usr/sbin'], + String[1] $exec_provider = 'shell', +) { $python_provider = getparam(Class['python'], 'provider') $python_version = getparam(Class['python'], 'version') if $virtualenv != 'system' { Python::Pyvenv <| |> -> Python::Pip[$name] - Python::Virtualenv <| |> -> Python::Pip[$name] } # Get SCL exec prefix @@ -111,9 +110,9 @@ } $pypi_index = $index ? { - false => '', - default => "--index-url=${index}", - } + false => '', + default => "--index-url=${index}", + } $proxy_flag = $proxy ? { undef => '', @@ -127,25 +126,26 @@ $install_editable = '' } - #TODO: Do more robust argument checking, but below is a start - if ($ensure == absent) and ($install_args != '') { + # TODO: Do more robust argument checking, but below is a start + if ($ensure == absent) and $install_args { fail('python::pip cannot provide install_args with ensure => absent') } - if ($ensure == present) and ($uninstall_args != '') { + if ($ensure == present) and $uninstall_args { fail('python::pip cannot provide uninstall_args with ensure => present') } if $pkgname =~ /==/ { - $parts = split($pkgname, '==') + $parts = split($pkgname, '==') $real_pkgname = $parts[0] + $_ensure = $ensure ? { 'absent' => 'absent', default => $parts[1], } } else { $real_pkgname = $pkgname - $_ensure = $ensure + $_ensure = $ensure } # Check if searching by explicit version. @@ -166,22 +166,22 @@ } $source = $url ? { - false => "${real_pkgname}${extras_string}", - /^(\/|[a-zA-Z]\:)/ => "'${url}'", + false => "${real_pkgname}${extras_string}", + /^(\/|[a-zA-Z]\:)/ => "'${url}'", /^(git\+|hg\+|bzr\+|svn\+)(http|https|ssh|svn|sftp|ftp|lp|git)(:\/\/).+$/ => "'${url}'", - default => "'${url}#egg=${egg_name}'", + default => "'${url}#egg=${egg_name}'", } - $pip_install = "${pip_env} --log ${log}/pip.log install" - $pip_common_args = "${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${source}" + $pip_install = "${pip_env} --log ${log}/pip.log install" + $pip_common_args = "${pypi_index} ${proxy_flag} ${install_editable} ${source}" # Explicit version out of VCS when PIP supported URL is provided if $source =~ /^'(git\+|hg\+|bzr\+|svn\+)(http|https|ssh|svn|sftp|ftp|lp|git)(:\/\/).+'$/ { if $_ensure != present and $_ensure != latest { - $command = "${pip_install} ${install_args} ${pip_common_args}@${_ensure}#egg=${egg_name}" + $command = "${pip_install} ${install_args} ${pip_common_args}@${_ensure}#egg=${egg_name}" $unless_command = "${pip_env} list | grep -i -e '${grep_regex}'" } else { - $command = "${pip_install} ${install_args} ${pip_common_args}" + $command = "${pip_install} ${install_args} ${pip_common_args}" $unless_command = "${pip_env} list | grep -i -e '${grep_regex}'" } } else { @@ -189,13 +189,13 @@ /^((19|20)[0-9][0-9]-(0[1-9]|1[1-2])-([0-2][1-9]|3[0-1])|[0-9]+\.\w+\+?\w*(\.\w+)*)$/: { # Version formats as per http://guide.python-distribute.org/specification.html#standard-versioning-schemes # Explicit version. - $command = "${pip_install} ${install_args} ${pip_common_args}==${_ensure}" + $command = "${pip_install} ${install_args} ${pip_common_args}==${_ensure}" $unless_command = "${pip_env} list | grep -i -e '${grep_regex}'" } 'present': { # Whatever version is available. - $command = "${pip_install} ${pip_common_args}" + $command = "${pip_install} ${install_args} ${pip_common_args}" $unless_command = "${pip_env} list | grep -i -e '${grep_regex}'" } @@ -203,24 +203,24 @@ # Unfortunately this is the smartest way of getting the latest available package version with pip as of now # Note: we DO need to repeat ourselves with "from version" in both grep and sed as on some systems pip returns # more than one line with paretheses. - $latest_version = join(["${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", - ' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"', - ' | tr -d "[:space:]"']) + $latest_version = join( [ + "${pip_install} ${pypi_index} ${proxy_flag} ${install_args} ${install_editable} ${real_pkgname}==notreallyaversion 2>&1", + ' | grep -oP "\(from versions: .*\)" | sed -E "s/\(from versions: (.*?, )*(.*)\)/\2/g"', + ' | tr -d "[:space:]"', + ]) # Packages with underscores in their names are listed with dashes in their place in `pip freeze` output - $pkgname_with_dashes = regsubst($real_pkgname, '_', '-', 'G') + $pkgname_with_dashes = regsubst($real_pkgname, '_', '-', 'G') $grep_regex_pkgname_with_dashes = "^${pkgname_with_dashes}==" - $installed_version = join(["${pip_env} freeze --all", - " | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3", - " | tr -d '[:space:]'"]) + $installed_version = join( ["${pip_env} freeze --all", " | grep -i -e ${grep_regex_pkgname_with_dashes} | cut -d= -f3", " | tr -d '[:space:]'",]) - $command = "${pip_install} --upgrade ${pip_common_args}" + $command = "${pip_install} --upgrade ${install_args} ${pip_common_args}" $unless_command = "[ \$(${latest_version}) = \$(${installed_version}) ]" } default: { # Anti-action, uninstall. - $command = "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${name}" + $command = "echo y | ${pip_env} uninstall ${uninstall_args} ${proxy_flag} ${real_pkgname}" $unless_command = "! ${pip_env} list | grep -i -e '${grep_regex}'" } } @@ -243,5 +243,4 @@ path => $_path, provider => $exec_provider, } - } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/pip/bootstrap.pp --- a/modules/python/manifests/pip/bootstrap.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/pip/bootstrap.pp Mon Jan 03 17:13:06 2022 +0000 @@ -1,19 +1,19 @@ -# # @summary allow to bootstrap pip when python is managed from other module # # @param version should be pip or pip3 # @param manage_python if python module will manage deps # @param http_proxy Proxy server to use for outbound connections. # -# @example +# @example # class { 'python::pip::bootstrap': # version => 'pip', # } +# class python::pip::bootstrap ( - Enum['pip', 'pip3'] $version = 'pip', - Variant[Boolean, String] $manage_python = false, - Optional[Stdlib::HTTPUrl] $http_proxy = undef, - String[1] $exec_provider = 'shell', + Enum['pip', 'pip3'] $version = 'pip', + Variant[Boolean, String] $manage_python = false, + Optional[Stdlib::HTTPUrl] $http_proxy = undef, + String[1] $exec_provider = 'shell', ) inherits python::params { if $manage_python { include python @@ -26,8 +26,8 @@ $environ = $http_proxy ? { undef => [], default => $facts['os']['family'] ? { - 'AIX' => [ "http_proxy=${http_proxy}", "https_proxy=${http_proxy}" ], - default => [ "HTTP_PROXY=${http_proxy}", "HTTPS_PROXY=${http_proxy}" ], + 'AIX' => ["http_proxy=${http_proxy}", "https_proxy=${http_proxy}"], + default => ["HTTP_PROXY=${http_proxy}", "HTTPS_PROXY=${http_proxy}"], } } @@ -40,6 +40,7 @@ require => Package['python3'], provider => $exec_provider, } + # puppet is opinionated about the pip command name file { 'pip3-python': ensure => link, @@ -56,6 +57,7 @@ require => Package['python'], provider => $exec_provider, } + # puppet is opinionated about the pip command name file { 'pip-python': ensure => link, diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/pyvenv.pp --- a/modules/python/manifests/pyvenv.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/pyvenv.pp Mon Jan 03 17:13:06 2022 +0000 @@ -22,15 +22,16 @@ # } # define python::pyvenv ( - $ensure = present, - $version = 'system', - $systempkgs = false, - $venv_dir = $name, - $owner = 'root', - $group = 'root', - $mode = '0755', - $path = [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ], - $environment = [], + Python::Package::Ensure $ensure = present, + Python::Version $version = 'system', + Boolean $systempkgs = false, + Stdlib::Absolutepath $venv_dir = $name, + String[1] $owner = 'root', + String[1] $group = 'root', + Stdlib::Filemode $mode = '0755', + Array[Stdlib::Absolutepath] $path = ['/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin',], + Array $environment = [], + Python::Venv::PipVersion $pip_version = 'latest', ) { include python @@ -40,24 +41,19 @@ default => $version, } - $python_version_parts = split($python_version, '[.]') + $python_version_parts = split($python_version, '[.]') $normalized_python_version = sprintf('%s.%s', $python_version_parts[0], $python_version_parts[1]) # Debian splits the venv module into a seperate package - if ( $facts['os']['family'] == 'Debian'){ - $python3_venv_package="python${normalized_python_version}-venv" - case $facts['os']['distro']['codename'] { - 'xenial','bionic','cosmic','disco', - 'jessie','stretch','buster': { - ensure_packages ($python3_venv_package) - Package[$python3_venv_package] -> File[$venv_dir] - } - default: {} - } + if ( $facts['os']['family'] == 'Debian') { + $python3_venv_package = "python${normalized_python_version}-venv" + ensure_packages($python3_venv_package) + + Package[$python3_venv_package] -> File[$venv_dir] } # pyvenv is deprecated since 3.6 and will be removed in 3.8 - if (versioncmp($normalized_python_version, '3.6') >=0) { + if versioncmp($normalized_python_version, '3.6') >=0 { $virtualenv_cmd = "${python::exec_prefix}python${normalized_python_version} -m venv" } else { $virtualenv_cmd = "${python::exec_prefix}pyvenv-${normalized_python_version}" @@ -68,7 +64,7 @@ default => $path, } - if ( $systempkgs == true ) { + if $systempkgs == true { $system_pkgs_flag = '--system-site-packages' } else { $system_pkgs_flag = '' @@ -81,15 +77,21 @@ mode => $mode, } - $pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip" + $pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip" + + $pip_upgrade = ($pip_version != 'latest') ? { + true => "--upgrade 'pip ${pip_version}'", + false => '--upgrade pip', + } exec { "python_virtualenv_${venv_dir}": - command => "${virtualenv_cmd} --clear ${system_pkgs_flag} ${venv_dir} && ${pip_cmd} --log ${venv_dir}/pip.log install --upgrade pip && ${pip_cmd} --log ${venv_dir}/pip.log install --upgrade setuptools", + command => "${virtualenv_cmd} --clear ${system_pkgs_flag} ${venv_dir} && ${pip_cmd} --log ${venv_dir}/pip.log install ${pip_upgrade} && ${pip_cmd} --log ${venv_dir}/pip.log install --upgrade setuptools", user => $owner, creates => "${venv_dir}/bin/activate", path => $_path, cwd => '/tmp', environment => $environment, + timeout => 600, 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], } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/requirements.pp --- a/modules/python/manifests/requirements.pp Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/manifests/requirements.pp Mon Jan 03 17:13:06 2022 +0000 @@ -10,7 +10,7 @@ # @param src Pip --src parameter to; if the requirements file contains --editable resources, this parameter specifies where they will be installed. See the pip documentation for more. # @param environment Additional environment variables required to install the packages. # @param forceupdate Run a pip install requirements even if we don't receive an event from the requirements file - Useful for when the requirements file is written as part of a resource other than file (E.g vcsrepo) -# @param cwd The directory from which to run the "pip install" command. +# @param cwd The directory from which to run the "pip install" command. # @param extra_pip_args Extra arguments to pass to pip after the requirements file # @param manage_requirements Create the requirements file if it doesn't exist. # @param fix_requirements_owner Change owner and group of requirements file. @@ -26,23 +26,22 @@ # } # define python::requirements ( - $requirements = $name, - $virtualenv = 'system', - Enum['pip', 'pip3'] $pip_provider = 'pip', - $owner = 'root', - $group = 'root', - Optional[Stdlib::HTTPUrl] $proxy = undef, - $src = false, - $environment = [], - $forceupdate = false, - $cwd = undef, - $extra_pip_args = '', - $manage_requirements = true, - $fix_requirements_owner = true, - $log_dir = '/tmp', - $timeout = 1800, + Stdlib::Absolutepath $requirements = $name, + Variant[Enum['system'],Stdlib::Absolutepath] $virtualenv = 'system', + Enum['pip', 'pip3'] $pip_provider = 'pip', + String[1] $owner = 'root', + String[1] $group = 'root', + Optional[Stdlib::HTTPUrl] $proxy = undef, + Any $src = false, + Array $environment = [], + Boolean $forceupdate = false, + Optional[Stdlib::Absolutepath] $cwd = undef, + Optional[String[1]] $extra_pip_args = undef, + Boolean $manage_requirements = true, + Boolean $fix_requirements_owner = true, + Stdlib::Absolutepath $log_dir = '/tmp', + Integer $timeout = 1800, ) { - include python if $virtualenv == 'system' and ($owner != 'root' or $group != 'root') { @@ -81,7 +80,7 @@ # the same requirements file. if !defined(File[$requirements]) and $manage_requirements == true { file { $requirements: - ensure => present, + ensure => file, mode => '0644', owner => $owner_real, group => $group_real, @@ -89,6 +88,7 @@ replace => false, content => '# Puppet will install and/or update pip packages listed here', } + $local_subscribe = File[$requirements] } else { $local_subscribe = undef diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/manifests/virtualenv.pp --- a/modules/python/manifests/virtualenv.pp Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -# -# @summary Creates Python virtualenv. -# -# @param ensure -# @param version Python version to use. -# @param requirements Path to pip requirements.txt file -# @param systempkgs Copy system site-packages into virtualenv. -# @param venv_dir Directory to install virtualenv to -# @param ensure_venv_dir Create $venv_dir -# @param distribute Include distribute in the virtualenv -# @param index Base URL of Python package index -# @param owner The owner of the virtualenv being manipulated -# @param group The group relating to the virtualenv being manipulated -# @param mode Optionally specify directory mode -# @param proxy Proxy server to use for outbound connections -# @param environment Additional environment variables required to install the packages -# @param path Specifies the PATH variable -# @param cwd The directory from which to run the "pip install" command -# @param timeout The maximum time in seconds the "pip install" command should take -# @param pip_args Arguments to pass to pip during initialization -# @param extra_pip_args Extra arguments to pass to pip after requirements file -# -# @example install a virtual env at /var/www/project1 -# python::virtualenv { '/var/www/project1': -# ensure => present, -# version => 'system', -# requirements => '/var/www/project1/requirements.txt', -# proxy => 'http://proxy.domain.com:3128', -# systempkgs => true, -# index => 'http://www.example.com/simple/', -# } -# -define python::virtualenv ( - $ensure = 'present', - $version = 'system', - $requirements = false, - $systempkgs = false, - $venv_dir = $name, - $ensure_venv_dir = true, - $distribute = true, - $index = false, - $owner = 'root', - $group = 'root', - $mode = '0755', - Optional[Stdlib::HTTPUrl] $proxy = undef, - $environment = [], - $path = [ '/bin', '/usr/bin', '/usr/sbin', '/usr/local/bin' ], - $cwd = undef, - $timeout = 1800, - $pip_args = '', - $extra_pip_args = '', - $virtualenv = undef, -) { - include python - $python_provider = getparam(Class['python'], 'provider') - $anaconda_path = getparam(Class['python'], 'anaconda_install_path') - - if $ensure == 'present' { - $python = $version ? { - 'system' => 'python', - 'pypy' => 'pypy', - default => "python${version}", - } - - $_path = $python_provider ? { - 'anaconda' => concat(["${anaconda_path}/bin"], $path), - default => $path, - } - - if $virtualenv == undef { - $used_virtualenv = 'virtualenv' - } else { - $used_virtualenv = $virtualenv - } - - $proxy_flag = $proxy ? { - false => '', - default => "--proxy=${proxy}", - } - - $proxy_hash = $proxy ? { - undef => {}, - default => $facts['os']['family'] ? { - 'AIX' => { 'http_proxy' => $proxy, 'https_proxy' => $proxy }, - default => { 'HTTP_PROXY' => $proxy, 'HTTPS_PROXY' => $proxy }, - } - } - - # Virtualenv versions prior to 1.7 do not support the - # --system-site-packages flag, default off for prior versions - # Prior to version 1.7 the default was equal to --system-site-packages - # and the flag --no-site-packages had to be passed to do the opposite - $_virtualenv_version = getvar('virtualenv_version') ? { - /.*/ => getvar('virtualenv_version'), - default => '', - } - if (( versioncmp($_virtualenv_version,'1.7') > 0 ) and ( $systempkgs == true )) { - $system_pkgs_flag = '--system-site-packages' - } elsif (( versioncmp($_virtualenv_version,'1.7') < 0 ) and ( $systempkgs == false )) { - $system_pkgs_flag = '--no-site-packages' - } else { - $system_pkgs_flag = $systempkgs ? { - true => '--system-site-packages', - false => '--no-site-packages', - default => fail('Invalid value for systempkgs. Boolean value is expected') - } - } - - $distribute_pkg = $distribute ? { - true => 'distribute', - default => 'setuptools', - } - $pypi_index = $index ? { - false => '', - default => "-i ${index}", - } - - # Python 2.6 and older does not support setuptools/distribute > 0.8 which - # is required for pip wheel support, pip therefor requires --no-use-wheel flag - # if the # pip version is more recent than 1.4.1 but using an old python or - # setuputils/distribute version - # To check for this we test for wheel parameter using help and then using - # version, this makes sure we only use wheels if they are supported - - if $ensure_venv_dir { - file { $venv_dir: - ensure => directory, - owner => $owner, - group => $group, - mode => $mode, - } - } - - $virtualenv_cmd = "${python::exec_prefix}${used_virtualenv}" - - $pip_cmd = "${python::exec_prefix}${venv_dir}/bin/pip" - $pip_flags = "${pypi_index} ${proxy_flag} ${pip_args}" - - exec { "python_virtualenv_${venv_dir}": - command => "${virtualenv_cmd} ${system_pkgs_flag} -p ${python} ${venv_dir} && ${pip_cmd} --log ${venv_dir}/pip.log install ${pip_flags} --upgrade pip && ${pip_cmd} install ${pip_flags} --upgrade ${distribute_pkg}", - user => $owner, - creates => "${venv_dir}/bin/activate", - path => $_path, - cwd => '/tmp', - environment => (Hash($environment.map |$val| { $val.split(/=|$/) }) + $proxy_hash).map|$key, $val| { "${key}=${val}" }, - 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], - } - - if $requirements { - exec { "python_requirements_initial_install_${requirements}_${venv_dir}": - command => "${pip_cmd} --log ${venv_dir}/pip.log install ${pypi_index} ${proxy_flag} --no-binary :all: -r ${requirements} ${extra_pip_args}", - refreshonly => true, - timeout => $timeout, - user => $owner, - subscribe => Exec["python_virtualenv_${venv_dir}"], - environment => $environment, - cwd => $cwd, - } - - python::requirements { "${requirements}_${venv_dir}": - requirements => $requirements, - virtualenv => $venv_dir, - proxy => $proxy, - owner => $owner, - group => $group, - cwd => $cwd, - require => Exec["python_virtualenv_${venv_dir}"], - extra_pip_args => $extra_pip_args, - } - } - } elsif $ensure == 'absent' { - file { $venv_dir: - ensure => absent, - force => true, - recurse => true, - purge => true, - } - } -} diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/metadata.json --- a/modules/python/metadata.json Mon Jan 03 17:09:39 2022 +0000 +++ b/modules/python/metadata.json Mon Jan 03 17:13:06 2022 +0000 @@ -1,23 +1,12 @@ { "name": "puppet-python", - "version": "4.0.0", + "version": "6.2.1", "author": "Vox Pupuli", "summary": "Python Module", "license": "Apache-2.0", - "source": "git://github.com/voxpupuli/puppet-python.git", + "source": "https://github.com/voxpupuli/puppet-python.git", "project_page": "https://github.com/voxpupuli/puppet-python", "issues_url": "https://github.com/voxpupuli/puppet-python/issues", - "dependencies": [ - { - "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.19.0 < 7.0.0" - }, - { - "name": "stahnma/epel", - "version_requirement": ">= 1.2.2 < 2.0.0" - } - ], - "data_provider": null, "description": "Puppet module for Python", "tags": [ "python", @@ -36,15 +25,24 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6", - "7" + "7", + "8" ] }, { "operatingsystem": "Debian", "operatingsystemrelease": [ - "8", - "9" + "9", + "10", + "11" + ] + }, + { + "operatingsystem": "FreeBSD", + "operatingsystemrelease": [ + "11", + "12", + "13" ] }, { @@ -54,7 +52,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "16.04", - "18.04" + "18.04", + "20.04" ] }, { @@ -67,7 +66,17 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.5.8 < 7.0.0" + "version_requirement": ">= 6.1.0 < 8.0.0" + } + ], + "dependencies": [ + { + "name": "puppetlabs/stdlib", + "version_requirement": ">= 4.19.0 < 9.0.0" + }, + { + "name": "puppet/epel", + "version_requirement": ">= 3.0.0 < 4.0.0" } ] } diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/class_spec.rb --- a/modules/python/spec/acceptance/class_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'python class' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'works with no errors' do - pp = <<-EOS - class { 'python': } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/facts_test_spec.rb --- a/modules/python/spec/acceptance/facts_test_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'python class' do - context 'facts' do - install_python = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - EOS - - fact_notices = <<-EOS - notify{"pip_version: ${::pip_version}":} - notify{"system_python_version: ${::system_python_version}":} - notify{"python_version: ${::python_version}":} - notify{"virtualenv_version: ${::virtualenv_version}":} - EOS - - # rubocop:disable RSpec/RepeatedExample - it 'outputs python facts when not installed' do # rubocop:disable RSpec/MultipleExpectations - apply_manifest(fact_notices, catch_failures: true) do |r| - expect(r.stdout).to match(%r{python_version: \S+}) - expect(r.stdout).to match(%r{pip_version: \S+}) - expect(r.stdout).to match(%r{virtualenv_version: \S+}) - expect(r.stdout).to match(%r{system_python_version: \S+}) - end - end - - it 'sets up python' do - apply_manifest(install_python, catch_failures: true) - end - - it 'outputs python facts when installed' do # rubocop:disable RSpec/MultipleExpectations - apply_manifest(fact_notices, catch_failures: true) do |r| - expect(r.stdout).to match(%r{python_version: \S+}) - expect(r.stdout).to match(%r{pip_version: \S+}) - expect(r.stdout).to match(%r{virtualenv_version: \S+}) - expect(r.stdout).to match(%r{system_python_version: \S+}) - end - end - # rubocop:enable RSpec/RepeatedExample - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/archlinux-2-x64.yml --- a/modules/python/spec/acceptance/nodesets/archlinux-2-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -HOSTS: - archlinux-2-x64: - roles: - - master - platform: archlinux-2-x64 - box: archlinux/archlinux - hypervisor: vagrant -CONFIG: - type: foss diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/centos-59-x64.yml --- a/modules/python/spec/acceptance/nodesets/centos-59-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -HOSTS: - centos-59-x64: - roles: - - master - platform: el-5-x86_64 - box : centos-59-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-59-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: git diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/centos-64-x64-pe.yml --- a/modules/python/spec/acceptance/nodesets/centos-64-x64-pe.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ -HOSTS: - centos-64-x64: - roles: - - master - - database - - dashboard - platform: el-6-x86_64 - box : centos-64-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: pe diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/centos-65-x64.yml --- a/modules/python/spec/acceptance/nodesets/centos-65-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -HOSTS: - centos-65-x64: - roles: - - master - platform: el-6-x86_64 - box : centos-65-x64-vbox436-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/debian-70rc1-x64.yml --- a/modules/python/spec/acceptance/nodesets/debian-70rc1-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -HOSTS: - debian-70rc1-x64: - roles: - - master - platform: debian-70rc1-x64 - box : debian-70rc1-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-70rc1-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/debian-73-x64.yml --- a/modules/python/spec/acceptance/nodesets/debian-73-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -HOSTS: - debian-73-x64: - roles: - - master - platform: debian-7-amd64 - box : debian-73-x64-virtualbox-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-nocm.box - hypervisor : vagrant -CONFIG: - log_level: debug - type: git \ No newline at end of file diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/default.yml --- a/modules/python/spec/acceptance/nodesets/default.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -HOSTS: - ubuntu-server-12042-x64: - roles: - - master - platform: ubuntu-server-12.04-amd64 - box : ubuntu-server-12042-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss - vagrant_ssh_port_random: true diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml --- a/modules/python/spec/acceptance/nodesets/ec2/amazonlinux-2016091.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,31 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -# Amazon Linux is not a RHEL clone. -# -HOSTS: - amazonlinux-2016091-x64: - roles: - - master - platform: centos-6-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: amazonlinux-2016091-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/image_templates.yaml --- a/modules/python/spec/acceptance/nodesets/ec2/image_templates.yaml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# see also: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -# Hint: image IDs (ami-*) for the same image are different per location. -# -AMI: - # Amazon Linux AMI 2016.09.1 (HVM), SSD Volume Type - amazonlinux-2016091-eu-central-1: - :image: - :aio: ami-af0fc0c0 - :region: eu-central-1 - # Red Hat Enterprise Linux 7.3 (HVM), SSD Volume Type - rhel-73-eu-central-1: - :image: - :aio: ami-e4c63e8b - :region: eu-central-1 - # SUSE Linux Enterprise Server 12 SP2 (HVM), SSD Volume Type - sles-12sp2-eu-central-1: - :image: - :aio: ami-c425e4ab - :region: eu-central-1 - # Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ubuntu-1604-eu-central-1: - :image: - :aio: ami-fe408091 - :region: eu-central-1 - # Microsoft Windows Server 2016 Base - windows-2016-base-eu-central-1: - :image: - :aio: ami-88ec20e7 - :region: eu-central-1 diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/rhel-73-x64.yml --- a/modules/python/spec/acceptance/nodesets/ec2/rhel-73-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - rhel-73-x64: - roles: - - master - platform: el-7-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: rhel-73-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml --- a/modules/python/spec/acceptance/nodesets/ec2/sles-12sp2-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - sles-12sp2-x64: - roles: - - master - platform: sles-12-x86_64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: sles-12sp2-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml --- a/modules/python/spec/acceptance/nodesets/ec2/ubuntu-1604-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - ubuntu-1604-x64: - roles: - - master - platform: ubuntu-16.04-amd64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: ubuntu-1604-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ubuntu -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml --- a/modules/python/spec/acceptance/nodesets/ec2/windows-2016-base-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ ---- -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# Additional ~/.fog config file with AWS EC2 credentials -# required. -# -# see: https://github.com/puppetlabs/beaker/blob/master/docs/how_to/hypervisors/ec2.md -# -HOSTS: - windows-2016-base-x64: - roles: - - master - platform: windows-2016-64 - hypervisor: ec2 - # refers to image_tempaltes.yaml AMI[vmname] entry: - vmname: windows-2016-base-eu-central-1 - # refers to image_tempaltes.yaml entry inside AMI[vmname][:image]: - snapshot: aio - # t2.micro is free tier eligible (https://aws.amazon.com/en/free/): - amisize: t2.micro - # required so that beaker sanitizes sshd_config and root authorized_keys: - user: ec2-user -CONFIG: - type: aio - :ec2_yaml: spec/acceptance/nodesets/ec2/image_templates.yaml -... -# vim: syntax=yaml diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml --- a/modules/python/spec/acceptance/nodesets/ubuntu-server-10044-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-10044-x64: - roles: - - master - platform: ubuntu-10.04-amd64 - box : ubuntu-server-10044-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-10044-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml --- a/modules/python/spec/acceptance/nodesets/ubuntu-server-12042-x64.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-server-12042-x64: - roles: - - master - platform: ubuntu-12.04-amd64 - box : ubuntu-server-12042-x64-vbox4210-nocm - box_url : http://puppet-vagrant-boxes.puppetlabs.com/ubuntu-server-12042-x64-vbox4210-nocm.box - hypervisor : vagrant -CONFIG: - type: foss diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/acceptance/virtualenv_spec.rb --- a/modules/python/spec/acceptance/virtualenv_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'python class' do - context 'default parameters' do - # Using puppet_apply as a helper - it 'works with no errors' do - pp = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv', - owner => 'root', - group => 'root', - } - -> python::pip { 'rpyc' : - ensure => '3.2.3', - virtualenv => '/opt/venv', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - - it 'maintains pip version' do - pp = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv2', - owner => 'root', - group => 'root', - } - -> python::pip { 'pip' : - ensure => '18.0', - virtualenv => '/opt/venv2', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - - it 'works with ensure=>latest' do - pp = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv3', - owner => 'root', - group => 'root', - } - -> python::pip { 'rpyc' : - ensure => 'latest', - virtualenv => '/opt/venv3', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - # Of course this test will fail if between the applies a new version of the package will be released, - # but probability of this happening is minimal, so it should be acceptable. - apply_manifest(pp, catch_changes: true) - end - - it 'works with ensure=>latest for package with underscore in its name' do - pp = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv4', - owner => 'root', - group => 'root', - } - -> python::pip { 'int_date' : - ensure => 'latest', - virtualenv => '/opt/venv4', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - # Of course this test will fail if between the applies a new version of the package will be released, - # but probability of this happening is minimal, so it should be acceptable. - apply_manifest(pp, catch_changes: true) - end - - it 'works with editable=>true' do - pp = <<-EOS - package{ 'git' : - ensure => 'present', - } - -> class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv5', - owner => 'root', - group => 'root', - } - -> python::pip { 'rpyc' : - ensure => '4.1.0', - url => 'git+https://github.com/tomerfiliba/rpyc.git', - editable => true, - virtualenv => '/opt/venv5', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - - it 'works with == in pkgname' do - pp = <<-EOS - class { 'python' : - version => 'system', - pip => 'present', - virtualenv => 'present', - } - -> python::virtualenv { 'venv' : - ensure => 'present', - systempkgs => false, - venv_dir => '/opt/venv6', - owner => 'root', - group => 'root', - } - -> python::pip { 'rpyc==4.1.0' : - virtualenv => '/opt/venv6', - } - EOS - - # Run it twice and test for idempotency - apply_manifest(pp, catch_failures: true) - apply_manifest(pp, catch_changes: true) - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/classes/python_spec.rb --- a/modules/python/spec/classes/python_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,568 +0,0 @@ -require 'spec_helper' - -describe 'python', type: :class do - on_supported_os.each do |os, facts| - next if os == 'gentoo-3-x86_64' - context "on #{os}" do - let :facts do - facts - end - - case facts[:os]['family'] - when 'Debian' - - # tests were written for Debian 6 - context 'on Debian OS' do - it { is_expected.to contain_class('python::install') } - # Base debian packages. - it { is_expected.to contain_package('python') } - it { is_expected.to contain_package('python-dev') } - it { is_expected.to contain_package('pip') } - # Basic python packages (from pip) - it { is_expected.to contain_package('virtualenv') } - - describe 'with python::version' do - context 'python3.7' do - let(:params) { { version: 'python3.7' } } - - it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_package('pip').with_name('python3.7-pip') } - it { is_expected.to contain_package('python').with_name('python3.7') } - it { is_expected.to contain_package('python-dev').with_name('python3.7-dev') } - it { is_expected.to contain_package('virtualenv').with_name('virtualenv') } - end - end - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'empty/default' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'with python::virtualenv, without python::dev' do - context 'true' do - let(:params) { { dev: 'absent', virtualenv: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'empty/default' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'with python::python_virtualenvs' do - context 'when `proxy` set' do - let(:params) do - { - python_virtualenvs: { - '/opt/env1' => { - proxy: 'http://example.com:3128' - } - } - } - end - - it { is_expected.to contain_exec('python_virtualenv_/opt/env1').with_environment(['HTTP_PROXY=http://example.com:3128', 'HTTPS_PROXY=http://example.com:3128']) } - end - context 'when `proxy` and `environment` have conflicting parameters' do - let(:params) do - { - python_virtualenvs: { - '/opt/env1' => { - proxy: 'http://example.com:3128', - environment: ['HTTP_PROXY=http://example.com:8080'] - } - } - } - end - - it { is_expected.to contain_exec('python_virtualenv_/opt/env1').with_environment(['HTTP_PROXY=http://example.com:3128', 'HTTPS_PROXY=http://example.com:3128']) } - end - end - - describe 'with python::python_pyvenvs' do - context 'with two pyenvs' do - let(:params) do - { - python_pyvenvs: { - '/opt/env1' => { - version: '3.8' - }, - '/opt/env2' => { - version: '3.8' - } - } - } - end - - it { is_expected.to compile } - - it { is_expected.to contain_python__pyvenv('/opt/env1').with_ensure('present') } - it { is_expected.to contain_python__pyvenv('/opt/env2').with_ensure('present') } - end - end - - describe 'with manage_gunicorn' do - context 'true' do - let(:params) { { manage_gunicorn: true } } - - it { is_expected.to contain_package('gunicorn') } - end - context 'empty args' do - # let(:params) {{ :manage_gunicorn => '' }} - it { is_expected.to contain_package('gunicorn') } - end - context 'false' do - let(:params) { { manage_gunicorn: false } } - - it { is_expected.not_to contain_package('gunicorn') } - end - end - - describe 'with python::provider' do - context 'pip' do - let(:params) { { pip: 'present', provider: 'pip' } } - - it { - is_expected.to contain_package('virtualenv').with( - 'provider' => 'pip' - ) - } - it { - is_expected.to contain_package('pip').with( - 'provider' => 'pip' - ) - } - end - - # python::provider - context 'default' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv') } - it { is_expected.to contain_package('pip') } - - describe 'with python::virtualenv' do - context 'true' do - let(:params) { { provider: '', virtualenv: 'present' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('present') } - end - end - - describe 'without python::virtualenv' do - context 'default/empty' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('absent') } - end - end - end - end - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'default/empty' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'EPEL does not exist for Debian' do - context 'default/empty' do - it { is_expected.not_to contain_class('epel') } - end - end - end - when 'RedHat' - case facts[:os]['name'] - when 'Fedora' - - # written for Fedora 22 - context 'on a Fedora OS' do - describe 'EPEL does not exist for Fedora' do - context 'default/empty' do - it { is_expected.not_to contain_class('epel') } - end - end - end - when 'RedHat', 'CentOS' - case facts[:os]['release']['major'] - when '5' - # written for RHEL 5 - context 'on a Redhat OS' do - it { is_expected.to contain_class('python::install') } - # Base debian packages. - it { is_expected.to contain_package('python') } - it { is_expected.to contain_package('python-dev').with_name('python-devel') } - it { is_expected.to contain_package('python-dev').with_alias('python-devel') } - it { is_expected.to contain_package('pip') } - it { is_expected.to contain_package('pip').with_name('python-pip') } - # Basic python packages (from pip) - it { is_expected.to contain_package('virtualenv') } - - describe 'EPEL may be needed on EL' do - context 'default/empty' do - it { is_expected.to contain_class('epel') } - end - end - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'empty/default' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'with manage_gunicorn' do - context 'true' do - let(:params) { { manage_gunicorn: true } } - - it { is_expected.to contain_package('gunicorn') } - end - context 'empty args' do - # let(:params) {{ :manage_gunicorn => '' }} - it { is_expected.to contain_package('gunicorn') } - end - context 'false' do - let(:params) { { manage_gunicorn: false } } - - it { is_expected.not_to contain_package('gunicorn') } - end - end - - describe 'with python::provider' do - context 'pip' do - let(:params) { { provider: 'pip' } } - - it { - is_expected.to contain_package('virtualenv').with( - 'provider' => 'pip' - ) - } - it { - is_expected.to contain_package('pip').with( - 'provider' => 'pip' - ) - } - end - - context 'anaconda' do - let(:params) { { provider: 'anaconda', anaconda_install_path: '/opt/test_path' } } - - it { - is_expected.to contain_file('/var/tmp/anaconda_installer.sh') - is_expected.to contain_exec('install_anaconda_python').with_command('/var/tmp/anaconda_installer -b -p /opt/test_path') - is_expected.to contain_exec('install_anaconda_virtualenv').with_command('/opt/test_path/bin/pip install virtualenv') - } - end - - # python::provider - context 'default' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv') } - it { is_expected.to contain_package('pip') } - - describe 'with python::virtualenv' do - context 'true' do - let(:params) { { provider: '', virtualenv: 'present' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('present') } - end - end - - describe 'with python::virtualenv' do - context 'default/empty' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('absent') } - end - end - end - end - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'default/empty' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - end - when '6' - - context 'on a Redhat 6 OS' do - it { is_expected.to contain_class('python::install') } - it { is_expected.to contain_package('pip').with_name('python-pip') } - - describe 'with python::provider' do - context 'scl' do - describe 'with version' do - context '3.6 SCL meta package' do - let(:params) { { version: 'rh-python36' } } - - it { is_expected.to compile.with_all_deps } - end - context '3.6 SCL python package' do - let(:params) { { version: 'rh-python36-python' } } - - it { is_expected.to compile.with_all_deps } - end - end - describe 'with manage_scl' do - context 'true' do - let(:params) { { provider: 'scl', manage_scl: true } } - - it { is_expected.to contain_package('centos-release-scl') } - it { is_expected.to contain_package('scl-utils') } - end - context 'false' do - let(:params) { { provider: 'scl', manage_scl: false } } - - it { is_expected.not_to contain_package('centos-release-scl') } - it { is_expected.not_to contain_package('scl-utils') } - end - end - end - end - end - - when '7' - - context 'on a Redhat 7 OS' do - it { is_expected.to contain_class('python::install') } - it { is_expected.to contain_package('pip').with_name('python2-pip') } - - describe 'with python::version' do - context 'python36' do - let(:params) { { version: 'python36' } } - - it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_package('pip').with_name('python36-pip') } - it { is_expected.to contain_package('python').with_name('python36') } - it { is_expected.to contain_package('python-dev').with_name('python36-devel') } - it { is_expected.to contain_package('virtualenv').with_name('python36-virtualenv') } - end - end - describe 'with python::provider' do - context 'scl' do - describe 'with version' do - context '3.6 SCL meta package' do - let(:params) { { version: 'rh-python36' } } - - it { is_expected.to compile.with_all_deps } - end - context '3.6 SCL python package' do - let(:params) { { version: 'rh-python36-python' } } - - it { is_expected.to compile.with_all_deps } - end - end - describe 'with manage_scl' do - context 'true' do - let(:params) { { provider: 'scl', manage_scl: true } } - - it { is_expected.to contain_package('centos-release-scl') } - it { is_expected.to contain_package('scl-utils') } - end - context 'false' do - let(:params) { { provider: 'scl', manage_scl: false } } - - it { is_expected.not_to contain_package('centos-release-scl') } - it { is_expected.not_to contain_package('scl-utils') } - end - end - end - end - end - end - end - when 'Suse' - # written for SLES 11 SP3 - - context 'on a SLES 11 SP3' do - it { is_expected.to contain_class('python::install') } - # Base Suse packages. - it { is_expected.to contain_package('python') } - it { is_expected.to contain_package('python-dev').with_name('python-devel') } - it { is_expected.to contain_package('python-dev').with_alias('python-devel') } - it { is_expected.to contain_package('pip') } - # Basic python packages (from pip) - it { is_expected.to contain_package('virtualenv') } - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'empty/default' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'with manage_gunicorn' do - context 'true' do - let(:params) { { manage_gunicorn: true } } - - it { is_expected.to contain_package('gunicorn') } - end - context 'empty args' do - # let(:params) {{ :manage_gunicorn => '' }} - it { is_expected.to contain_package('gunicorn') } - end - context 'false' do - let(:params) { { manage_gunicorn: false } } - - it { is_expected.not_to contain_package('gunicorn') } - end - end - - describe 'with python::provider' do - context 'pip' do - let(:params) { { provider: 'pip' } } - - it { - is_expected.to contain_package('virtualenv').with( - 'provider' => 'pip' - ) - } - it { - is_expected.to contain_package('pip').with( - 'provider' => 'pip' - ) - } - end - - # python::provider - context 'default' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv') } - it { is_expected.to contain_package('pip') } - - describe 'with python::virtualenv' do - context 'true' do - let(:params) { { provider: '', virtualenv: 'present' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('present') } - end - end - - describe 'with python::virtualenv' do - context 'default/empty' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('absent') } - end - end - end - end - - describe 'with python::dev' do - context 'true' do - let(:params) { { dev: 'present' } } - - it { is_expected.to contain_package('python-dev').with_ensure('present') } - end - context 'default/empty' do - it { is_expected.to contain_package('python-dev').with_ensure('absent') } - end - end - - describe 'EPEL does not exist on Suse' do - context 'default/empty' do - it { is_expected.not_to contain_class('epel') } - end - end - end - when 'Gentoo' - - context 'on a Gentoo OS' do - it { is_expected.to contain_class('python::install') } - # Base debian packages. - it { is_expected.to contain_package('python') } - it { is_expected.to contain_package('pip').with('category' => 'dev-python') } - # Basic python packages (from pip) - it { is_expected.to contain_package('virtualenv') } - # Python::Dev - it { is_expected.not_to contain_package('python-dev') } - - describe 'with manage_gunicorn' do - context 'true' do - let(:params) { { manage_gunicorn: true } } - - it { is_expected.to contain_package('gunicorn') } - end - context 'empty args' do - # let(:params) {{ :manage_gunicorn => '' }} - it { is_expected.to contain_package('gunicorn') } - end - context 'false' do - let(:params) { { manage_gunicorn: false } } - - it { is_expected.not_to contain_package('gunicorn') } - end - end - - describe 'with python::provider' do - context 'pip' do - let(:params) { { pip: 'present', provider: 'pip' } } - - it { - is_expected.to contain_package('virtualenv').with( - 'provider' => 'pip' - ) - } - it { - is_expected.to contain_package('pip').with( - 'provider' => 'pip' - ) - } - end - - # python::provider - context 'default' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv') } - it { is_expected.to contain_package('pip') } - - describe 'with python::virtualenv' do - context 'true' do - let(:params) { { provider: '', virtualenv: 'present' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('present') } - end - end - - describe 'with python::virtualenv' do - context 'default/empty' do - let(:params) { { provider: '' } } - - it { is_expected.to contain_package('virtualenv').with_ensure('absent') } - end - end - end - end - end - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/default_module_facts.yml --- a/modules/python/spec/default_module_facts.yml Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ ---- -python_version: "2.7" -python3_version: ~ diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/defines/dotfile_spec.rb --- a/modules/python/spec/defines/dotfile_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,50 +0,0 @@ -require 'spec_helper' - -describe 'python::dotfile', type: :define do - on_supported_os.each do |os, facts| - context("on #{os} ") do - let :facts do - facts - end - - describe 'dotfile as' do - context 'fails with empty string filename' do - let(:title) { '' } - - it { is_expected.to raise_error(%r{Evaluation Error: Empty string title at 0. Title strings must have a length greater than zero.}) } - end - context 'fails with incorrect mode' do - let(:title) { '/etc/pip.conf' } - let(:params) { { mode: 'not-a-mode' } } - - it { is_expected.to raise_error(%r{Evaluation Error: Error while evaluating a Resource}) } - end - context 'succeeds with filename in existing path' do - let(:title) { '/etc/pip.conf' } - - it { is_expected.to contain_file('/etc/pip.conf').with_mode('0644') } - end - context 'succeeds with filename in a non-existing path' do - let(:title) { '/home/someuser/.pip/pip.conf' } - - it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o root -g root -d /home/someuser/.pip') } - it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_mode('0644') } - end - context 'succeeds when set owner' do - let(:title) { '/home/someuser/.pip/pip.conf' } - let(:params) { { owner: 'someuser' } } - - it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o someuser -g root -d /home/someuser/.pip') } - it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_owner('someuser') } - end - context 'succeeds when set group set' do - let(:title) { '/home/someuser/.pip/pip.conf' } - let(:params) { { group: 'somegroup' } } - - it { is_expected.to contain_exec('create /home/someuser/.pip/pip.conf\'s parent dir').with_command('install -o root -g somegroup -d /home/someuser/.pip') } - it { is_expected.to contain_file('/home/someuser/.pip/pip.conf').with_group('somegroup') } - end - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/defines/gunicorn_spec.rb --- a/modules/python/spec/defines/gunicorn_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -require 'spec_helper' - -describe 'python::gunicorn', type: :define do - let(:title) { 'test-app' } - - context 'on Debian OS' do - let :facts do - { - id: 'root', - kernel: 'Linux', - lsbdistcodename: 'squeeze', - osfamily: 'Debian', - operatingsystem: 'Debian', - operatingsystemrelease: '6', - path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', - concat_basedir: '/dne' - } - end - - describe 'test-app with default parameter values' do - context 'configures test app with default parameter values' do - let(:params) { { dir: '/srv/testapp' } } - - it { is_expected.to contain_file('/etc/gunicorn.d/test-app').with_mode('0644').with_content(%r{--log-level=error}) } - end - - context 'test-app with custom log level' do - let(:params) { { dir: '/srv/testapp', log_level: 'info' } } - - it { is_expected.to contain_file('/etc/gunicorn.d/test-app').with_mode('0644').with_content(%r{--log-level=info}) } - end - - context 'test-app with custom gunicorn preload arguments' do - let(:params) { { dir: '/srv/testapp', args: ['--preload'] } } - - it { is_expected.to contain_file('/etc/gunicorn.d/test-app').with_mode('0644').with_content(%r{--preload}) } - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/defines/pip_spec.rb --- a/modules/python/spec/defines/pip_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,155 +0,0 @@ -require 'spec_helper' - -describe 'python::pip', type: :define do # rubocop:disable RSpec/MultipleDescribes - let(:title) { 'rpyc' } - - context 'on Debian OS' do - let :facts do - { - id: 'root', - kernel: 'Linux', - lsbdistcodename: 'squeeze', - os: { - family: 'Debian' - }, - osfamily: 'Debian', - operatingsystem: 'Debian', - operatingsystemrelease: '6', - path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', - concat_basedir: '/dne' - } - end - - describe 'virtualenv as' do - context 'fails with non qualified path' do - let(:params) { { virtualenv: 'venv' } } - - it { is_expected.to raise_error(%r{expects a match for Variant\[Enum\['system'\].*Stdlib::Windowspath = Pattern\[\/.*\/\], Stdlib::Unixpath = Pattern\[\/.*\/\]\]}) } - end - context 'suceeds with qualified path' do - let(:params) { { virtualenv: '/opt/venv' } } - - it { is_expected.to contain_exec('pip_install_rpyc').with_cwd('/opt/venv') } - end - context 'defaults to system' do - let(:params) { {} } - - it { is_expected.to contain_exec('pip_install_rpyc').with_cwd('/') } - end - end - - describe 'pip_provide as' do - context 'defaults to pip' do - let(:params) { {} } - - it { is_expected.to contain_exec('pip_install_rpyc').with_command(%r{pip}) } - it { is_expected.not_to contain_exec('pip_install_rpyc').with_command(%r{pip3}) } - end - context 'use pip instead of pip3 when specified' do - let(:params) { { pip_provider: 'pip' } } - - it { is_expected.to contain_exec('pip_install_rpyc').with_command(%r{pip}) } - it { is_expected.not_to contain_exec('pip_install_rpyc').with_command(%r{pip3}) } - end - context 'use pip3 instead of pip when specified' do - let(:params) { { pip_provider: 'pip3' } } - - it { is_expected.to contain_exec('pip_install_rpyc').with_command(%r{pip3}) } - end - end - - describe 'proxy as' do - context 'defaults to empty' do - let(:params) { {} } - - it { is_expected.not_to contain_exec('pip_install_rpyc').with_command(%r{--proxy}) } - end - context 'adds proxy to install command if proxy set' do - let(:params) { { proxy: 'http://my.proxy:3128' } } - - it { is_expected.to contain_exec('pip_install_rpyc').with_command('pip --log /tmp/pip.log install --proxy=http://my.proxy:3128 rpyc') } - end - end - - describe 'index as' do - context 'defaults to empty' do - let(:params) { {} } - - it { is_expected.not_to contain_exec('pip_install_rpyc').with_command(%r{--index-url}) } - end - context 'adds index to install command if index set' do - let(:params) { { index: 'http://www.example.com/simple/' } } - - it { is_expected.to contain_exec('pip_install_rpyc').with_command('pip --log /tmp/pip.log install --index-url=http://www.example.com/simple/ rpyc') } - end - end - - describe 'path as' do - context 'adds anaconda path to pip invocation if provider is anaconda' do - let(:params) { {} } - let(:pre_condition) { 'class {"python": provider => "anaconda", anaconda_install_path => "/opt/python3"}' } - - it { is_expected.to contain_exec('pip_install_rpyc').with_path(['/opt/python3/bin', '/usr/local/bin', '/usr/bin', '/bin', '/usr/sbin']) } - end - end - - describe 'install latest' do - context 'does not use pip search in unless' do - let(:params) { { ensure: 'latest' } } - - it { is_expected.not_to contain_exec('pip_install_rpyc').with_unless(%r{search}) } - end - context 'checks installed version of a package by converting underscores in its name to dashes' do - let(:params) { { ensure: 'latest', pkgname: 'wordpress_json' } } - - # yes, the exec title does not change if we use different pgkname - it { is_expected.to contain_exec('pip_install_rpyc').with_unless(%r{wordpress-json}) } - end - end - - describe 'uninstall' do - context 'adds correct title' do - let(:params) { { ensure: 'absent' } } - - it { is_expected.not_to contain_exec('pip_install_rpyc') } - - it { is_expected.to contain_exec('pip_uninstall_rpyc').with_command(%r{uninstall.*rpyc$}) } - end - end - end -end - -describe 'python::pip', type: :define do - let(:title) { 'requests' } - - context 'on Debian OS' do - let :facts do - { - id: 'root', - kernel: 'Linux', - lsbdistcodename: 'squeeze', - os: { - family: 'Debian' - }, - osfamily: 'Debian', - operatingsystem: 'Debian', - operatingsystemrelease: '6', - path: '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', - concat_basedir: '/dne' - } - end - - describe 'extras as' do - context 'suceeds with no extras' do - let(:params) { {} } - - it { is_expected.to contain_exec('pip_install_requests').with_command('pip --log /tmp/pip.log install requests') } - end - context 'succeeds with extras' do - let(:params) { { extras: ['security'] } } - - it { is_expected.to contain_exec('pip_install_requests').with_command('pip --log /tmp/pip.log install requests[security]') } - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/defines/pyvenv_spec.rb --- a/modules/python/spec/defines/pyvenv_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -require 'spec_helper' - -describe 'python::pyvenv', type: :define do - on_supported_os.each do |os, facts| - next if os == 'gentoo-3-x86_64' - context "on #{os}" do - let :facts do - # python3 is required to use pyvenv - facts.merge( - python3_version: '3.5.1' - ) - end - let :title do - '/opt/env' - end - - context 'with default parameters' do - it { is_expected.to contain_file('/opt/env') } - it { is_expected.to contain_exec('python_virtualenv_/opt/env').with_command('pyvenv-3.5 --clear /opt/env && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade pip && /opt/env/bin/pip --log /opt/env/pip.log install --upgrade setuptools') } - - if %w[xenial bionic cosmic disco jessie stretch buster].include?(facts[:lsbdistcodename]) - it { is_expected.to contain_package('python3.5-venv').that_comes_before('File[/opt/env]') } - end - end - - describe 'when ensure' do - context 'is absent' do - let :params do - { - ensure: 'absent' - } - end - - it { - is_expected.to contain_file('/opt/env').with_ensure('absent').with_purge(true) - } - end - end - end # context - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/defines/requirements_spec.rb --- a/modules/python/spec/defines/requirements_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -require 'spec_helper' - -describe 'python::requirements', type: :define do - on_supported_os.each do |os, facts| - next if os == 'gentoo-3-x86_64' - context "on #{os}" do - let :facts do - facts - end - - let :title do - '/requirements.txt' - end - - context 'with /requirements.txt' do - let :params do - { - requirements: '/requirements.txt' - } - end - - it { is_expected.to contain_file('/requirements.txt').with_mode('0644') } - - context 'with manage_requirements => false' do - let(:params) { super().merge(manage_requirements: false) } - - it { is_expected.not_to contain_file('/requirements.txt') } - end - end - - describe 'with owner' do - context 'bob:bob' do - let :params do - { - owner: 'bob', - group: 'bob' - } - end - - it { is_expected.to compile.and_raise_error(%r{root user must be used when virtualenv is system}) } - end - end - - context 'default' do - it { is_expected.to contain_file('/requirements.txt').with_owner('root').with_group('root') } - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/spec.opts --- a/modules/python/spec/spec.opts Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ ---format -s ---colour ---loadby -mtime ---backtrace diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/spec_helper.rb --- a/modules/python/spec/spec_helper.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -RSpec.configure do |c| - c.mock_with :mocha -end - -require 'puppetlabs_spec_helper/module_spec_helper' -require 'rspec-puppet-facts' -require 'bundler' -include RspecPuppetFacts - -if ENV['DEBUG'] - Puppet::Util::Log.level = :debug - Puppet::Util::Log.newdestination(:console) -end - -if File.exist?(File.join(__dir__, 'default_module_facts.yml')) - facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml'))) - if facts - facts.each do |name, value| - add_custom_fact name.to_sym, value - end - end -end - -if Dir.exist?(File.expand_path('../../lib', __FILE__)) - require 'coveralls' - require 'simplecov' - require 'simplecov-console' - SimpleCov.formatters = [ - SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console - ] - SimpleCov.start do - track_files 'lib/**/*.rb' - add_filter '/spec' - add_filter '/vendor' - add_filter '/.vendor' - add_filter Bundler.configured_bundle_path.path - end -end - -RSpec.configure do |c| - # getting the correct facter version is tricky. We use facterdb as a source to mock facts - # see https://github.com/camptocamp/facterdb - # people might provide a specific facter version. In that case we use it. - # Otherwise we need to match the correct facter version to the used puppet version. - # as of 2019-10-31, puppet 5 ships facter 3.11 and puppet 6 ships facter 3.14 - # https://puppet.com/docs/puppet/5.5/about_agent.html - c.default_facter_version = if ENV['FACTERDB_FACTS_VERSION'] - ENV['FACTERDB_FACTS_VERSION'] - else - Gem::Dependency.new('', ENV['PUPPET_VERSION']).match?('', '5') ? '3.11.0' : '3.14.0' - end - - # Coverage generation - c.after(:suite) do - RSpec::Puppet::Coverage.report! - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/spec_helper_acceptance.rb --- a/modules/python/spec/spec_helper_acceptance.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -require 'beaker-rspec' -require 'beaker-puppet' -require 'beaker/puppet_install_helper' -require 'beaker/module_install_helper' - -run_puppet_install_helper unless ENV['BEAKER_provision'] == 'no' - -RSpec.configure do |c| - # Readable test descriptions - c.formatter = :documentation - - # Configure all nodes in nodeset - c.before :suite do - install_module - install_module_dependencies - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/unit/facter/pip_version_spec.rb --- a/modules/python/spec/unit/facter/pip_version_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -require 'spec_helper' - -describe Facter::Util::Fact do - before do - Facter.clear - end - - let(:pip_version_output) do - <<-EOS -pip 6.0.6 from /opt/boxen/homebrew/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg (python 2.7) -EOS - end - - describe 'pip_version' do - context 'returns pip version when pip present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('pip').returns(true) - Facter::Util::Resolution.expects(:exec).with('pip --version 2>&1').returns(pip_version_output) - expect(Facter.value(:pip_version)).to eq('6.0.6') - end - end - - context 'returns nil when pip not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('pip').returns(false) - expect(Facter.value(:pip_version)).to eq(nil) - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/unit/facter/python_release_spec.rb --- a/modules/python/spec/unit/facter/python_release_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -require 'spec_helper' - -describe Facter::Util::Fact do - before do - Facter.clear - end - - let(:python2_version_output) do - <<-EOS -Python 2.7.9 -EOS - end - let(:python3_version_output) do - <<-EOS -Python 3.3.0 -EOS - end - - describe 'python_release' do - context 'returns Python release when `python` present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python_release)).to eq('2.7') - end - end - - context 'returns nil when `python` not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(false) - expect(Facter.value(:python_release)).to eq(nil) - end - end - end - - describe 'python2_release' do - context 'returns Python 2 release when `python` is present and Python 2' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python2_release)).to eq('2.7') - end - end - - context 'returns Python 2 release when `python` is Python 3 and `python2` is present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python3_version_output) - Facter::Util::Resolution.expects(:which).with('python2').returns(true) - Facter::Util::Resolution.expects(:exec).with('python2 -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python2_release)).to eq('2.7') - end - end - - context 'returns nil when `python` is Python 3 and `python2` is absent' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python3_version_output) - Facter::Util::Resolution.expects(:which).with('python2').returns(false) - expect(Facter.value(:python2_release)).to eq(nil) - end - end - - context 'returns nil when `python2` and `python` are absent' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(false) - Facter::Util::Resolution.expects(:which).with('python2').returns(false) - expect(Facter.value(:python2_release)).to eq(nil) - end - end - end - - describe 'python3_release' do - context 'returns Python 3 release when `python3` present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python3').returns(true) - Facter::Util::Resolution.expects(:exec).with('python3 -V 2>&1').returns(python3_version_output) - expect(Facter.value(:python3_release)).to eq('3.3') - end - end - - context 'returns nil when `python3` not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python3').returns(false) - expect(Facter.value(:python3_release)).to eq(nil) - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/unit/facter/python_version_spec.rb --- a/modules/python/spec/unit/facter/python_version_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -require 'spec_helper' - -describe Facter::Util::Fact do - before do - Facter.clear - end - - let(:python2_version_output) do - <<-EOS -Python 2.7.9 -EOS - end - let(:python3_version_output) do - <<-EOS -Python 3.3.0 -EOS - end - - describe 'python_version' do - context 'returns Python version when `python` present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python_version)).to eq('2.7.9') - end - end - - context 'returns nil when `python` not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(false) - expect(Facter.value(:python_version)).to eq(nil) - end - end - end - - describe 'python2_version' do - context 'returns Python 2 version when `python` is present and Python 2' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python2_version)).to eq('2.7.9') - end - end - - context 'returns Python 2 version when `python` is Python 3 and `python2` is present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python3_version_output) - Facter::Util::Resolution.expects(:which).with('python2').returns(true) - Facter::Util::Resolution.expects(:exec).with('python2 -V 2>&1').returns(python2_version_output) - expect(Facter.value(:python2_version)).to eq('2.7.9') - end - end - - context 'returns nil when `python` is Python 3 and `python2` is absent' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(true) - Facter::Util::Resolution.expects(:exec).with('python -V 2>&1').returns(python3_version_output) - Facter::Util::Resolution.expects(:which).with('python2').returns(false) - expect(Facter.value(:python2_version)).to eq(nil) - end - end - - context 'returns nil when `python2` and `python` are absent' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python').returns(false) - Facter::Util::Resolution.expects(:which).with('python2').returns(false) - expect(Facter.value(:python2_version)).to eq(nil) - end - end - end - - describe 'python3_version' do - context 'returns Python 3 version when `python3` present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python3').returns(true) - Facter::Util::Resolution.expects(:exec).with('python3 -V 2>&1').returns(python3_version_output) - expect(Facter.value(:python3_version)).to eq('3.3.0') - end - end - - context 'returns nil when `python3` not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('python3').returns(false) - expect(Facter.value(:python3_version)).to eq(nil) - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/spec/unit/facter/virtualenv_version_spec.rb --- a/modules/python/spec/unit/facter/virtualenv_version_spec.rb Mon Jan 03 17:09:39 2022 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -require 'spec_helper' - -describe Facter::Util::Fact do - before do - Facter.clear - end - - let(:virtualenv_version_output) do - <<-EOS -12.0.7 -EOS - end - - describe 'virtualenv_version' do - context 'returns virtualenv version when virtualenv present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('virtualenv').returns(true) - Facter::Util::Resolution.expects(:exec).with('virtualenv --version 2>&1').returns(virtualenv_version_output) - expect(Facter.value(:virtualenv_version)).to eq('12.0.7') - end - end - - context 'returns nil when virtualenv not present' do - it do - Facter::Util::Resolution.stubs(:exec) - Facter::Util::Resolution.expects(:which).with('virtualenv').returns(false) - expect(Facter.value(:virtualenv_version)).to eq(nil) - end - end - end -end diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/loglevel.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/loglevel.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,3 @@ +# @summary A version type to match all valid loglevels for python +# +type Python::Loglevel = Enum['debug', 'info', 'warning', 'error', 'critical'] diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/package/ensure.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/package/ensure.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,3 @@ +# @summary A version type to match all valid package ensures for python +# +type Python::Package::Ensure = Enum['absent', 'present', 'latest'] diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/provider.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/provider.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,3 @@ +# @summary A version type to match all valid provider for python +# +type Python::Provider = Enum['pip', 'scl', 'rhscl', 'anaconda', ''] diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/umask.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/umask.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,3 @@ +# @summary A version type to match valid umask for python +# +type Python::Umask = Pattern[/[0-7]{1,4}/] diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/venv/pipversion.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/venv/pipversion.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,6 @@ +# @summary A version type to ensure a specific Pip version in a virtual env. +# +type Python::Venv::PipVersion = Pattern[ + /^(<|>|<=|>=|==) [0-9]*(\.[0-9]+)*$/, + /\Alatest\Z/ +] diff -r 3fce34f642f1 -r 66c075c5f54a modules/python/types/version.pp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/modules/python/types/version.pp Mon Jan 03 17:13:06 2022 +0000 @@ -0,0 +1,8 @@ +# @summary A version type to match all valid versions for python +# +type Python::Version = Pattern[ + /\A(python)?[0-9](\.?[0-9])*/, + /\Apypy\Z/, + /\Asystem\Z/, + /\Arh-python[0-9]{2}(?:-python)?\Z/ +]