14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# editorconfig.org

# MANAGED BY MODULESYNC

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
tab_width = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
15 changes: 15 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ To run a specific spec test set the `SPEC` variable:
bundle exec rake spec SPEC=spec/foo_spec.rb
```

### Unit tests in docker

Some people don't want to run the dependencies locally or don't want to install
ruby. We ship a Dockerfile that enables you to run all unit tests and linting.
You only need to run:

```sh
docker build .
```

Please ensure that a docker daemon is running and that your user has the
permission to talk to it. You can specify a remote docker host by setting the
`DOCKER_HOST` environment variable. it will copy the content of the module into
the docker image. So it will not work if a Gemfile.lock exists.

## Integration tests

The unit tests just check the code runs, not that it does exactly what
Expand Down
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '2.2.0'
modulesync_config_version: '2.4.0'
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ Puppetfile.lock
*.iml
.*.sw?
.yardoc/
Dockerfile
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
sudo: false
dist: trusty
dist: xenial
language: ruby
cache: bundler
before_install:
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ 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.4.0](https://github.com/voxpupuli/puppet-hiera/tree/v3.4.0) (2019-04-25)

[Full Changelog](https://github.com/voxpupuli/puppet-hiera/compare/v3.3.4...v3.4.0)

**Implemented enhancements:**

- Support `hiera5\_defaults` `options` setting [\#253](https://github.com/voxpupuli/puppet-hiera/pull/253) ([alexjfisher](https://github.com/alexjfisher))
- Extend Hiera 5 template to support trocla backend [\#238](https://github.com/voxpupuli/puppet-hiera/pull/238) ([m4rx0](https://github.com/m4rx0))

**Merged pull requests:**

- Make `data\_hash` in `hiera5\_defaults` optional [\#254](https://github.com/voxpupuli/puppet-hiera/pull/254) ([alexjfisher](https://github.com/alexjfisher))
- Change hiera\_yaml to ensure file [\#247](https://github.com/voxpupuli/puppet-hiera/pull/247) ([m4rx0](https://github.com/m4rx0))
- README.md: remove some obsolete Puppet Open Source default values [\#241](https://github.com/voxpupuli/puppet-hiera/pull/241) ([kenyon](https://github.com/kenyon))
- README.md: remove note about FOSS Puppet 3 default [\#240](https://github.com/voxpupuli/puppet-hiera/pull/240) ([kenyon](https://github.com/kenyon))
- README.md: correct default of hiera5\_defaults [\#239](https://github.com/voxpupuli/puppet-hiera/pull/239) ([kenyon](https://github.com/kenyon))

## [v3.3.4](https://github.com/voxpupuli/puppet-hiera/tree/v3.3.4) (2018-10-20)

[Full Changelog](https://github.com/voxpupuli/puppet-hiera/compare/v3.3.3...v3.3.4)
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM ruby:2.5.1

WORKDIR /opt/puppet

# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv

ARG PUPPET_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4

# Cache gems
COPY Gemfile .
RUN bundle install --without system_tests development release --path=${BUNDLE_PATH:-vendor/bundle}

COPY . .

RUN bundle install
RUN bundle exec release_checks

# Container should not saved
RUN exit 1
7 changes: 4 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ group :test do
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'rack', '~> 1.0', :require => false if RUBY_VERSION < '2.2.2'
gem 'parallel_tests', :require => false
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'
end

group :development do
Expand All @@ -43,15 +44,15 @@ group :system_tests do
if beaker_version = ENV['BEAKER_VERSION']
gem 'beaker', *location_for(beaker_version)
else
gem 'beaker', '>= 3.9.0', :require => false
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.10', :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
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ The following parameters are available for the hiera class:
For Hiera verison 5.
Default: `[{}]`
* `hiera5_defaults`
To set hiera 5 defaults. e.g. datadir, data_hash
Default: `{}`
To set hiera 5 defaults. e.g. `datadir`, `data_hash`.
Default: `{'datadir' => 'data', 'data_hash' => 'yaml_data'}`
* `hiera_version`
Version format to layout hiera.yaml.
Should be a string.
Expand Down Expand Up @@ -336,7 +336,6 @@ The following parameters are available for the hiera class:
* `datadir`
The path to the directory where hiera will look for databases.
Default:
* `'/etc/puppet/hieradata'` for Puppet Open Source
* `'/etc/puppetlabs/puppet/hieradata'` for PE Puppet < 4
* `'/etc/puppetlabs/code/environments/%{::environment}/hieradata'` for Puppet >= 4
* `datadir_manage`
Expand Down Expand Up @@ -386,17 +385,15 @@ The following parameters are available for the hiera class:
A hash of options to set in hiera.yaml for the deep merge behavior.
Default: `{}`
* `manage_package`
A boolean for wether the hiera package should be managed. Defaults to `true` on
FOSS 3 but `false` otherwise.
A boolean for wether the hiera package should be managed.
Default: `false`
* `package_name`
Specifies the name of the hiera package. Default: 'hiera'
* `package_ensure`
Specifies the ensure value of the hiera package. Default: 'present'
* `confdir`
The path to Puppet's confdir.
Default: `$::settings::confdir` which should be the following:
* `'/etc/puppet'` for Puppet Open Source
* `'/etc/puppetlabs/puppet'` for Puppet Enterprise
Default: `$::settings::confdir` which should be `'/etc/puppetlabs/puppet'`
* `logger`
Which hiera logger to use.
**Note**: You need to manage any package/gem dependencies yourself.
Expand Down
2 changes: 1 addition & 1 deletion examples/init.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class { '::hiera':
class { 'hiera':
datadir => '/etc/puppetlabs/puppet/hieradata',
hierarchy => [
'%{environment}/%{calling_class}',
Expand Down
2 changes: 1 addition & 1 deletion manifests/eyaml_gpg.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

$manage_package = $::hiera::manage_eyaml_gpg_package

require ::hiera::eyaml
require hiera::eyaml

File {
owner => $owner,
Expand Down
8 changes: 4 additions & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
fail("${merge_behavior} merge behavior is invalid. Valid values are: native, deep, deeper")
}
if $merge_behavior != 'native' {
require ::hiera::deep_merge
require hiera::deep_merge
}
}

Expand Down Expand Up @@ -184,9 +184,9 @@
if $eyaml_gpg {
$encrypt_method = 'gpg'
$gpg_gnupghome = "${_keysdir}/gpg"
require ::hiera::eyaml_gpg
require hiera::eyaml_gpg
} elsif $eyaml {
require ::hiera::eyaml
require hiera::eyaml
$encrypt_method = undef
$gpg_gnupghome = undef
} else {
Expand Down Expand Up @@ -262,7 +262,7 @@
default: { $hiera_template = template('hiera/hiera.yaml.erb') } # Apply erb for default version 3
}
file { $hiera_yaml:
ensure => present,
ensure => file,
content => $hiera_template,
}
# Symlink for hiera command line tool
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$package_ensure = 'present'
$package_name = 'hiera'
$hierarchy = []
if str2bool($::is_pe) {
if str2bool($facts['is_pe']) {
$hiera_yaml = '/etc/puppetlabs/puppet/hiera.yaml'
$datadir = '/etc/puppetlabs/puppet/hieradata'
$owner = 'pe-puppet'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-hiera",
"version": "3.3.4",
"version": "3.4.0",
"author": "Vox Pupuli",
"summary": "Deploy hiera.yaml with hierarchy, and datadir",
"license": "Apache-2.0",
Expand Down
15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/centos-511-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/centos-6-x64.yml

This file was deleted.

17 changes: 0 additions & 17 deletions spec/acceptance/nodesets/centos-66-x64-pe.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/centos-66-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/centos-7-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/centos-72-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/debian-78-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/debian-82-x64.yml

This file was deleted.

15 changes: 0 additions & 15 deletions spec/acceptance/nodesets/fedora-24-x64.yml

This file was deleted.

16 changes: 0 additions & 16 deletions spec/acceptance/nodesets/fedora-25-x64.yml

This file was deleted.

Loading