Showing with 178 additions and 72 deletions.
  1. +3 −0 .gitignore
  2. +5 −0 .pdkignore
  3. +1 −0 .puppet-lint.rc
  4. +13 −2 .rubocop.yml
  5. +9 −0 .sync.yml
  6. +19 −21 .travis.yml
  7. +6 −0 .vscode/extensions.json
  8. +39 −28 CHANGELOG.md
  9. +1 −0 CODEOWNERS
  10. +12 −10 Gemfile
  11. +1 −1 README.md
  12. +13 −3 Rakefile
  13. +1 −0 data/common.yaml
  14. +21 −0 hiera.yaml
  15. +10 −0 lib/puppet/type/yumrepo.rb
  16. +6 −6 metadata.json
  17. +1 −0 spec/default_facts.yml
  18. +11 −1 spec/spec_helper.rb
  19. +6 −0 spec/unit/type/yumrepo_spec.rb
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
5 changes: 5 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
/convert_report.txt
/update_report.txt
.DS_Store
.project
.envrc
/inventory.yaml
/appveyor.yml
/.fixtures.yml
/Gemfile
Expand All @@ -30,8 +33,10 @@
/.gitlab-ci.yml
/.pdkignore
/Rakefile
/rakelib/
/.rspec
/.rubocop.yml
/.travis.yml
/.yardopts
/spec/
/.vscode/
1 change: 1 addition & 0 deletions .puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--relative
15 changes: 13 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
require: rubocop-rspec
require:
- rubocop-rspec
- rubocop-i18n
AllCops:
DisplayCopNames: true
TargetRubyVersion: '2.1'
Expand All @@ -19,10 +21,13 @@ AllCops:
Metrics/LineLength:
Description: People have wide screens, use them.
Max: 200
GetText:
Enabled: false
GetText/DecorateString:
Description: We don't want to decorate test output.
Exclude:
- spec/*
- spec/**/*
Enabled: false
RSpec/BeforeAfterAll:
Description: Beware of using after(:all) as it may cause state to leak between tests.
A necessary evil in acceptance testing.
Expand Down Expand Up @@ -86,6 +91,12 @@ Style/MethodCalledOnDoEndBlock:
Enabled: true
Style/StringMethods:
Enabled: true
GetText/DecorateFunctionMessage:
Enabled: false
GetText/DecorateStringFormattingUsingInterpolation:
Enabled: false
GetText/DecorateStringFormattingUsingPercent:
Enabled: false
Layout/EndOfLine:
Enabled: false
Metrics/AbcSize:
Expand Down
9 changes: 9 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
Layout/IndentHeredoc:
Enabled: false
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
required:
':system_tests':
- gem: 'puppet-module-posix-system-r#{minor_version}'
Expand Down Expand Up @@ -37,3 +43,6 @@ appveyor.yml:
global_env:
- "---BEAKER_PUPPET_COLLECTION=puppet5 PUPPET_GEM_VERSION=\"~> 5.0\""
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="git://github.com/puppetlabs/puppet#master"

Rakefile:
changelog_version_tag_pattern: '%s'
40 changes: 19 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
---
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
- if [ $BUNDLER_VERSION ]; then
gem install -v $BUNDLER_VERSION bundler --no-rdoc --no-ri;
fi
- bundle -v
- rm -f Gemfile.lock
- gem update --system $RUBYGEMS_VERSION
Expand All @@ -15,36 +12,37 @@ script:
- 'bundle exec rake $CHECK'
bundler_args: --without system_tests
rvm:
- 2.5.1
- 2.5.3
env:
global:
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="~> 6.0"
- BEAKER_PUPPET_COLLECTION=puppet6 PUPPET_GEM_VERSION="git://github.com/puppetlabs/puppet#master"
stages:
- static
- spec
- acceptance
-
if: tag =~ ^v\d
name: deploy
matrix:
fast_finish: true
include:
-
env: CHECK="syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop"
-
env: CHECK=parallel_spec
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
stage: static
-
env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec
rvm: 2.4.4
rvm: 2.4.5
stage: spec
-
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
rvm: 2.5.3
stage: spec
-
env: PUPPET_GEM_VERSION="~> 4.0" CHECK=parallel_spec RUBYGEMS_VERSION=2.7.8 BUNDLER_VERSION=1.17.3
rvm: 2.1.9
env: DEPLOY_TO_FORGE=yes
stage: deploy
branches:
only:
- master
- /^v\d/
notifications:
email: false
deploy:
provider: puppetforge
user: puppet
password:
secure: ""
on:
tags: true
all_branches: true
condition: "$DEPLOY_TO_FORGE = yes"
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"jpogran.puppet-vscode",
"rebornix.Ruby"
]
}
67 changes: 39 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,47 @@
# Changelog
# Change log

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
## [1.0.4](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.4) (2019-10-31)

## [1.0.3] - 2019-01-11
## Added
- Added LICENSE file
## Changed
- Updated Japanese translations
[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.3...1.0.4)

## [1.0.2] - 2018-11-29
### Added
- Added Japanese translation of README.md
- Added Japanese translations of localized strings
### Changed
- Travis is now testing against puppet4, puppet5, and puppet6
- Metadata updated to reflect a wider range of puppet versions this module does work with

- \(PUP-10028\) Add minrate to yumrepo [\#18](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/18) ([jtappa](https://github.com/jtappa))

## [1.0.3](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.3) (2019-01-11)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.2...1.0.3)

### Added

- \(maint\) add LICENSE file [\#13](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/13) ([melissa](https://github.com/melissa))

## [1.0.2](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.2) (2018-11-29)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.1...1.0.2)

### Added

- \(L10n\) Update Japanese translations [\#9](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/9) ([melissa](https://github.com/melissa))

### Fixed
- (MODULES-8114) Use old way of defining sensitive params

## [1.0.1] - 2018-08-17
- \(MODULES-8114\) Use old way of defining sensitive params [\#6](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/6) ([melissa](https://github.com/melissa))

## [1.0.1](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.1) (2018-08-17)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.0...1.0.1)

## [1.0.0](https://github.com/puppetlabs/puppetlabs-yumrepo_core/tree/1.0.0) (2018-07-09)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/5c905b7ed57e5c60b4469050b7306a9c9b78e304...1.0.0)

### Added
- (PUP-9053) Enable localization
### Changed
- Install module on all hosts, not just default role

## [1.0.0] - 2018-07-07
### Summary
This is the initial release of the extracted yumrepo module

[1.0.3]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/puppetlabs/puppetlabs-yumrepo_core/releases/tag/1.0.0

- Extract yumrepo type and provider from puppet [\#1](https://github.com/puppetlabs/puppetlabs-yumrepo_core/pull/1) ([joshcooper](https://github.com/joshcooper))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @puppetlabs/team-coremunity
22 changes: 12 additions & 10 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
minor_version = ruby_version_segments[0..1].join('.')

group :development do
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "puppet-module-posix-default-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0')
gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0')
gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0')
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
end
group :system_tests do
gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ Puppet Labs modules on the Puppet Forge are open projects, and community contrib

We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

For more information, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html)
For more information, see our [module contribution guide.](https://puppet.com/docs/puppet/latest/contributing.html)
16 changes: 13 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any?
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any?
Expand All @@ -14,15 +15,24 @@ end

def changelog_project
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = nil || JSON.load(File.read('metadata.json'))['name']
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?

returnVal = nil
returnVal ||= begin
metadata_source = JSON.load(File.read('metadata.json'))['source']
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})

metadata_source_match && metadata_source_match[1]
end

raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?

puts "GitHubChangelogGenerator project:#{returnVal}"
returnVal
end

def changelog_future_release
return unless Rake.application.top_level_tasks.include? "changelog"
returnVal = JSON.load(File.read('metadata.json'))['version']
returnVal = "%s" % JSON.load(File.read('metadata.json'))['version']
raise "unable to find the future_release (version) in metadata.json" if returnVal.nil?
puts "GitHubChangelogGenerator future_release:#{returnVal}"
returnVal
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
21 changes: 21 additions & 0 deletions hiera.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
version: 5

defaults: # Used for any hierarchy level that omits these keys.
datadir: data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: "osfamily/major release"
paths:
- "os/%{facts.os.family}/%{facts.os.release.major}.yaml"
# Used for Solaris
- "os/%{facts.os.family}/%{facts.kernelrelease}.yaml"
# Used to distinguish between Debian and Ubuntu
- "os/%{facts.os.name}/%{facts.os.release.major}.yaml"
- name: "osfamily"
paths:
- "os/%{facts.os.family}.yaml"
- "os/%{facts.os.name}.yaml"
- name: 'common'
path: 'common.yaml'
10 changes: 10 additions & 0 deletions lib/puppet/type/yumrepo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,16 @@
newvalues(%r{^-?\d+$}, :absent)
end

newproperty(:minrate) do
desc "Sets the low speed threshold in bytes per second.
If the server is sending data slower than this for at least
`timeout` seconds, Yum aborts the connection. The default is
`1000`.
#{ABSENT_DOC}"

newvalues(%r{^\d+$}, :absent)
end

newproperty(:throttle) do
desc "Enable bandwidth throttling for downloads. This option
can be expressed as a absolute data rate in bytes/sec or a
Expand Down
12 changes: 6 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "puppetlabs-yumrepo_core",
"version": "1.0.3",
"author": "Puppet Labs",
"version": "1.0.4",
"author": "puppetlabs",
"summary": "Manage client yum repo configurations by parsing yum INI configuration files.",
"license": "Apache-2.0",
"source": "https://github.com/puppetlabs/puppetlabs-yumrepo_core",
Expand Down Expand Up @@ -58,7 +58,7 @@
"version_requirement": ">= 4.7.0 < 7.0.0"
}
],
"pdk-version": "1.8.0",
"template-url": "https://github.com/puppetlabs/pdk-templates",
"template-ref": "heads/master-0-gd61c0a4"
}
"pdk-version": "1.14.0",
"template-url": "https://github.com/puppetlabs/pdk-templates#1.14.0",
"template-ref": "1.14.0-0-g1bf3a4e"
}
1 change: 1 addition & 0 deletions spec/default_facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
# Facts specified here will override the values provided by rspec-puppet-facts.
---
ipaddress: "172.16.254.254"
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
is_pe: false
macaddress: "AA:AA:AA:AA:AA:AA"
Loading