23 changes: 19 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,34 @@ You can install all needed gems for spec tests into the modules directory by
running:

```sh
bundle install --path .vendor/ --without development --without system_tests --without release
bundle install --path .vendor/ --without development system_tests release --jobs "$(nproc)"
```

If you also want to run acceptance tests:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"
```

Our all in one solution if you don't know if you need to install or update gems:

```sh
bundle install --path .vendor/ --without development --with system_tests --without release; bundle update; bundle clean
bundle install --path .vendor/ --with system_tests --without development release --jobs "$(nproc)"; bundle update; bundle clean
```

As an alternative to the `--jobs "$(nproc)` parameter, you can set an
environment variable:

```sh
BUNDLE_JOBS="$(nproc)"
```

### Note for OS X users

`nproc` isn't a valid command unter OS x. As an alternative, you can do:

```sh
--jobs "$(sysctl -n hw.ncpu)"
```

## Syntax and style
Expand Down Expand Up @@ -160,7 +175,7 @@ created virtual machines will be in `.vagrant/beaker_vagrant_files`.
Beaker also supports docker containers. We also use that in our automated CI
pipeline at [travis-ci](http://travis-ci.org). To use that instead of Vagrant:

```
```sh
PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker} BEAKER_destroy=yes bundle exec rake beaker
```

Expand Down
10 changes: 5 additions & 5 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Thank you for contributing to this project!
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.4.0'
modulesync_config_version: '2.8.0'
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
---
sudo: false
dist: xenial
language: ruby
cache: bundler
before_install:
- rm -f Gemfile.lock
- gem update --system
- gem update bundler
- bundle --version
script:
- 'bundle exec rake $CHECK'
matrix:
fast_finish: true
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.4
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=test_with_coveralls
- rvm: 2.5.1
- rvm: 2.5.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 6.0" CHECK=rubocop
- rvm: 2.4.4
Expand Down
33 changes: 29 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,32 @@ 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.

## [v4.0.0](https://github.com/voxpupuli/puppet-hiera/tree/v4.0.0) (2019-11-27)

[Full Changelog](https://github.com/voxpupuli/puppet-hiera/compare/v3.4.1...v4.0.0)

**Breaking changes:**

- drop Ubuntu 14.04 support [\#273](https://github.com/voxpupuli/puppet-hiera/pull/273) ([bastelfreak](https://github.com/bastelfreak))
- modulesync 2.7.0 and drop puppet 4 [\#249](https://github.com/voxpupuli/puppet-hiera/pull/249) ([bastelfreak](https://github.com/bastelfreak))

**Implemented enhancements:**

- hiera.yaml is word readable. Allow setting different permissions to hide secrets [\#266](https://github.com/voxpupuli/puppet-hiera/pull/266) ([maxadamo](https://github.com/maxadamo))

**Closed issues:**

- hiera.yaml is word readable, but it can contain secret tokens [\#265](https://github.com/voxpupuli/puppet-hiera/issues/265)
- Incompatible with Puppet-6 [\#263](https://github.com/voxpupuli/puppet-hiera/issues/263)
- Cannot install deep\_merge gem. [\#252](https://github.com/voxpupuli/puppet-hiera/issues/252)

**Merged pull requests:**

- allow puppetlabs/inifile 4.x [\#274](https://github.com/voxpupuli/puppet-hiera/pull/274) ([bastelfreak](https://github.com/bastelfreak))
- Clean up acceptance spec helper [\#272](https://github.com/voxpupuli/puppet-hiera/pull/272) ([ekohl](https://github.com/ekohl))
- Format options value as json if it is a hash [\#270](https://github.com/voxpupuli/puppet-hiera/pull/270) ([ZeroPointEnergy](https://github.com/ZeroPointEnergy))
- Allow `puppetlabs/stdlib` 6.x [\#262](https://github.com/voxpupuli/puppet-hiera/pull/262) ([alexjfisher](https://github.com/alexjfisher))

## [v3.4.1](https://github.com/voxpupuli/puppet-hiera/tree/v3.4.1) (2019-05-01)

[Full Changelog](https://github.com/voxpupuli/puppet-hiera/compare/v3.4.0...v3.4.1)
Expand All @@ -18,6 +44,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 3.4.1 [\#261](https://github.com/voxpupuli/puppet-hiera/pull/261) ([rnelson0](https://github.com/rnelson0))
- Allow `puppetlabs/inifile` 3.x [\#256](https://github.com/voxpupuli/puppet-hiera/pull/256) ([alexjfisher](https://github.com/alexjfisher))

## [v3.4.0](https://github.com/voxpupuli/puppet-hiera/tree/v3.4.0) (2019-04-25)
Expand Down Expand Up @@ -53,7 +80,6 @@ These should not affect the functionality of the module.

- allow puppetlabs/stdlib 5.x [\#231](https://github.com/voxpupuli/puppet-hiera/pull/231) ([bastelfreak](https://github.com/bastelfreak))
- allow puppetlabs/inifile 2.x [\#228](https://github.com/voxpupuli/puppet-hiera/pull/228) ([bastelfreak](https://github.com/bastelfreak))
- Remove docker nodesets [\#223](https://github.com/voxpupuli/puppet-hiera/pull/223) ([bastelfreak](https://github.com/bastelfreak))
- drop EOL OSs; fix puppet version range [\#222](https://github.com/voxpupuli/puppet-hiera/pull/222) ([bastelfreak](https://github.com/bastelfreak))

## [v3.3.2](https://github.com/voxpupuli/puppet-hiera/tree/v3.3.2) (2018-03-28)
Expand All @@ -66,6 +92,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Remove docker nodesets [\#223](https://github.com/voxpupuli/puppet-hiera/pull/223) ([bastelfreak](https://github.com/bastelfreak))
- bump puppet to latest supported version 4.10.0 [\#217](https://github.com/voxpupuli/puppet-hiera/pull/217) ([bastelfreak](https://github.com/bastelfreak))

## [v3.3.1](https://github.com/voxpupuli/puppet-hiera/tree/v3.3.1) (2017-12-09)
Expand All @@ -90,7 +117,7 @@ These should not affect the functionality of the module.

**Implemented enhancements:**

- Add datadir key for hiera5 hierarchy. [\#204](https://github.com/voxpupuli/puppet-hiera/pull/204) ([disappear89](https://github.com/disappear89))
- Add datadir key for hiera5 hierarchy. [\#204](https://github.com/voxpupuli/puppet-hiera/pull/204) ([ThoTischner](https://github.com/ThoTischner))

**Closed issues:**

Expand Down Expand Up @@ -214,9 +241,7 @@ These should not affect the functionality of the module.

- Relicense BSD-2-Clause to Apache-2.0 [\#149](https://github.com/voxpupuli/puppet-hiera/pull/149) ([hunner](https://github.com/hunner))
- Modulesync 0.12.2 & Release 2.1.1 [\#148](https://github.com/voxpupuli/puppet-hiera/pull/148) ([bastelfreak](https://github.com/bastelfreak))
- modulesync 0.11.1 [\#145](https://github.com/voxpupuli/puppet-hiera/pull/145) ([bastelfreak](https://github.com/bastelfreak))
- module is compatible with PE2016.2 [\#144](https://github.com/voxpupuli/puppet-hiera/pull/144) ([vchepkov](https://github.com/vchepkov))
- modulesync 0.11.0 [\#143](https://github.com/voxpupuli/puppet-hiera/pull/143) ([bastelfreak](https://github.com/bastelfreak))
- Update metadata.json to not give dependency errors in puppet3.8 [\#142](https://github.com/voxpupuli/puppet-hiera/pull/142) ([cryptk](https://github.com/cryptk))
- modulesync 0.8.0 [\#139](https://github.com/voxpupuli/puppet-hiera/pull/139) ([bastelfreak](https://github.com/bastelfreak))
- modulesync 0.6.2 [\#137](https://github.com/voxpupuli/puppet-hiera/pull/137) ([bastelfreak](https://github.com/bastelfreak))
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.5.1
FROM ruby:2.5.3

WORKDIR /opt/puppet

Expand Down
22 changes: 11 additions & 11 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '>= 2.11.0', :require => false
gem 'puppetlabs_spec_helper', '>= 2.14.0', :require => false
gem 'rspec-puppet-facts', '>= 1.8.0', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppet-lint-leading_zero-check', :require => false
Expand All @@ -20,16 +20,16 @@ group :test do
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 'metadata-json-lint', :require => false
gem 'redcarpet', :require => false
gem 'rubocop', '~> 0.49.1', :require => false if RUBY_VERSION >= '2.3.0'
gem 'rubocop-rspec', '~> 1.15.0', :require => false if RUBY_VERSION >= '2.3.0'
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 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'parallel_tests', '2.24.0', :require => false if RUBY_VERSION < '2.2.0'
gem 'parallel_tests', :require => false if RUBY_VERSION >= '2.2.0'
gem 'parallel_tests', :require => false
end

group :development do
Expand Down Expand Up @@ -57,16 +57,16 @@ group :system_tests do
gem 'beaker-puppet', :require => false
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper', :require => false
gem 'rbnacl', '>= 4', :require => false if RUBY_VERSION >= '2.2.6'
gem 'rbnacl-libsodium', :require => false if RUBY_VERSION >= '2.2.6'
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/github-changelog-generator/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/github-changelog-generator/github-changelog-generator'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '>= 1.0', :require => false
gem 'puppet-strings', '>= 2.2', :require => false
end


Expand All @@ -77,7 +77,7 @@ else
gem 'facter', :require => false, :groups => [:test]
end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 5.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 6.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]

# vim: syntax=ruby
58 changes: 24 additions & 34 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,12 @@ require 'puppetlabs_spec_helper/rake_tasks'
# load optional tasks for releases
# only available if gem group releases is installed
begin
require 'puppet_blacksmith/rake_tasks'
require 'voxpupuli/release/rake_tasks'
require 'puppet-strings/tasks'
rescue LoadError
end

PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
PuppetLint.configuration.absolute_classname_reverse = true

exclude_paths = %w(
pkg/**/*
Expand All @@ -28,20 +21,32 @@ PuppetSyntax.exclude_paths = exclude_paths

desc 'Auto-correct puppet-lint offenses'
task 'lint:auto_correct' do
PuppetLint.configuration.fix = true
Rake::Task[:lint].invoke
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 metadata_lint, release_checks'
task test: [
:metadata_lint,
:release_checks,
]
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
Expand All @@ -54,25 +59,10 @@ task test_with_coveralls: [:test] do
end
end

desc "Print supported beaker sets"
task 'beaker_sets', [:directory] do |t, args|
directory = args[:directory]

metadata = JSON.load(File.read('metadata.json'))

(metadata['operatingsystem_support'] || []).each do |os|
(os['operatingsystemrelease'] || []).each do |release|
if directory
beaker_set = "#{directory}/#{os['operatingsystem'].downcase}-#{release}"
else
beaker_set = "#{os['operatingsystem'].downcase}-#{release}-x64"
end

filename = "spec/acceptance/nodesets/#{beaker_set}.yml"

puts beaker_set if File.exists? filename
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
Expand Down
10 changes: 5 additions & 5 deletions manifests/deep_merge.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
# Copyright (C) 2016 Joseph Yaworski, unless otherwise noted.
#
class hiera::deep_merge {
$provider = $::hiera::provider
$deep_merge_version = $::hiera::deep_merge_version
$deep_merge_source = $::hiera::deep_merge_source
$deep_merge_name = $::hiera::deep_merge_name
$manage_package = $::hiera::manage_deep_merge_package
$provider = $hiera::provider
$deep_merge_version = $hiera::deep_merge_version
$deep_merge_source = $hiera::deep_merge_source
$deep_merge_name = $hiera::deep_merge_name
$manage_package = $hiera::manage_deep_merge_package

if $manage_package {
::hiera::install { 'deep_merge':
Expand Down
22 changes: 11 additions & 11 deletions manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
# Copyright (C) 2014 Terri Haber, unless otherwise noted.
#
class hiera::eyaml {
$eyaml_name = $::hiera::eyaml_name
$provider = $::hiera::provider
$eyaml_version = $::hiera::eyaml_version
$eyaml_source = $::hiera::_eyaml_source
$eyaml_name = $hiera::eyaml_name
$provider = $hiera::provider
$eyaml_version = $hiera::eyaml_version
$eyaml_source = $hiera::_eyaml_source

$owner = $::hiera::eyaml_owner
$group = $::hiera::eyaml_group
$cmdpath = $::hiera::cmdpath
$confdir = $::hiera::confdir
$create_keys = $::hiera::create_keys
$_keysdir = $::hiera::_keysdir
$owner = $hiera::eyaml_owner
$group = $hiera::eyaml_group
$cmdpath = $hiera::cmdpath
$confdir = $hiera::confdir
$create_keys = $hiera::create_keys
$_keysdir = $hiera::_keysdir

$manage_package = $::hiera::manage_eyaml_package
$manage_package = $hiera::manage_eyaml_package

if $manage_package {
::hiera::install { 'eyaml':
Expand Down
Loading