Showing with 24 additions and 20 deletions.
  1. +0 −3 .rubocop.yml
  2. +6 −1 CHANGELOG.md
  3. +3 −3 Gemfile
  4. +7 −5 manifests/eyaml.pp
  5. +1 −1 metadata.json
  6. +1 −3 spec/acceptance/hiera_spec.rb
  7. +2 −2 spec/classes/hiera_spec.rb
  8. +4 −2 spec/spec_helper_acceptance.rb
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,6 @@ Style/SpaceInsideParens:
Style/LeadingCommentSpace:
Enabled: false

Style/SingleSpaceBeforeFirstArg:
Enabled: false

Style/SpaceAfterColon:
Enabled: false

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Change log
All notable changes to this project will be documented in this file.

## [2.0.0]
## [2.0.1] - 2016-01-27
### Fixes:
- Fix key creation when passing a custom `hiera::keysdir`

## [2.0.0] - 2016-01-26
### Changes:
- eyaml keys/ directory moved from `/etc/puppetlabs/code/keys` to
`/etc/puppetlabs/puppet/keys` on PE > 3.x. You should move you keys directory
Expand Down Expand Up @@ -120,6 +124,7 @@ All notable changes to this project will be documented in this file.
### Bugfixes:
- Only ensure datadir if it does not have `%{.*}`

[2.0.1]: https://github.com/hunner/puppet-hiera/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/hunner/puppet-hiera/compare/1.4.1...2.0.0
[1.4.1]: https://github.com/hunner/puppet-hiera/compare/1.4.0...1.4.1
[1.4.0]: https://github.com/hunner/puppet-hiera/compare/1.3.2...1.4.0
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
if ENV['PUPPET_GEM_VERSION']
gem 'puppet', ENV['PUPPET_GEM_VERSION'], :require => false
else
gem 'puppet', :require => false
end
Expand All @@ -13,7 +13,7 @@ group :test do
gem "puppetlabs_spec_helper"
gem "metadata-json-lint"
gem "rspec-puppet-facts"
gem 'rubocop'
gem 'rubocop', '0.33.0'
gem 'simplecov'
gem 'simplecov-console'

Expand Down
12 changes: 7 additions & 5 deletions manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,25 @@
ensure => directory,
}

$keysdir = dirname($_keysdir)

if ( $create_keys == true ) {
exec { 'createkeys':
user => $owner,
cwd => $confdir,
cwd => $keysdir,
command => 'eyaml createkeys',
path => $cmdpath,
creates => "${confdir}/keys/private_key.pkcs7.pem",
require => [ $hiera_package_depedencies, File["${confdir}/keys"] ],
creates => "${_keysdir}/private_key.pkcs7.pem",
require => [ $hiera_package_depedencies, File[$_keysdir] ],
}

file { "${confdir}/keys/private_key.pkcs7.pem":
file { "${_keysdir}/private_key.pkcs7.pem":
ensure => file,
mode => '0600',
require => Exec['createkeys'],
}

file { "${confdir}/keys/public_key.pkcs7.pem":
file { "${_keysdir}/public_key.pkcs7.pem":
ensure => file,
mode => '0644',
require => Exec['createkeys'],
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": "hunner-hiera",
"version": "2.0.0",
"version": "2.0.1",
"author": "hunner",
"summary": "Deploy hiera.yaml with hierarchy, and datadir",
"license": "BSD-2-Clause",
Expand Down
4 changes: 1 addition & 3 deletions spec/acceptance/hiera_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
fail "Unknown puppet version #{version}"
end
hierayaml = "#{confdir}/hiera.yaml"
sitepp = File.join(manifestsdir, 'site.pp')

describe 'puppet apply' do
it 'creates a hiera.yaml' do
Expand All @@ -43,7 +42,7 @@ class { 'hiera':
end
describe file(hierayaml), :node => master do
its(:content) do
should match( <<-EOS
should match <<-EOS
# managed by puppet
---
:backends:
Expand All @@ -65,7 +64,6 @@ class { 'hiera':
:pkcs7_private_key: #{confdir}/keys/private_key.pkcs7.pem
:pkcs7_public_key: #{confdir}/keys/public_key.pkcs7.pem
EOS
)
end
end
describe 'querying hiera' do
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/hiera_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'spec_helper'

describe 'hiera' do
if Puppet.version.match(/^(Puppet Enterprise )?3/)
if Puppet.version =~ /^(Puppet Enterprise )?3/
context "foss puppet 3" do
let(:facts) do
{ :puppetversion => Puppet.version, }
Expand Down Expand Up @@ -30,7 +30,7 @@
it { should contain_class("hiera::eyaml") }
end
end
elsif Puppet.version.match(/^4/)
elsif Puppet.version =~ /^4/
context "foss puppet 4" do
let(:facts) do
{ :puppetversion => Puppet.version, }
Expand Down
6 changes: 4 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def wait_for_master(max_retries)
1.upto(max_retries) do |retries|
on(master, "curl -skIL https://#{master.hostname}:8140", { :acceptable_exit_codes => [0,1,7] }) do |result|
return if result.stdout =~ %r{HTTP/1\.1 4}
return true if result.stdout =~ %r{HTTP/1\.1 4}

counter = 2 ** retries
logger.debug "Unable to reach Puppet Master, #{master.hostname}, Sleeping #{counter} seconds for retry #{retries}..."
Expand All @@ -15,14 +15,16 @@ def wait_for_master(max_retries)
raise "Could not connect to Puppet Master."
end

# rubocop:disable AbcSize
def make_site_pp(pp, path = File.join(master['puppetpath'], 'manifests'))
on master, "mkdir -p #{path}"
create_remote_file(master, File.join(path, "site.pp"), pp)
on master, "chown -R #{puppet_user(master)}:#{puppet_group(master)} #{path}"
on master, "chmod -R 0755 #{path}"
on master, "service #{(master['puppetservice']||"puppetserver")} restart"
on master, "service #{(master['puppetservice']||'puppetserver')} restart"
wait_for_master(3)
end
# rubocop:enable AbcSize

run_puppet_install_helper
unless ENV["RS_PROVISION"] == "no" or ENV["BEAKER_provision"] == "no"
Expand Down