Showing with 32 additions and 14 deletions.
  1. +7 −0 CHANGELOG
  2. +1 −1 Modulefile
  3. +1 −1 README.md
  4. +15 −10 manifests/eyaml.pp
  5. +6 −0 manifests/init.pp
  6. +1 −2 manifests/params.pp
  7. +1 −0 templates/hiera.yaml.erb
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2014-11-21 Release 1.1.1
Bugfixes:
- Correct handling of cmdpath (using an array of paths instead of hardcoded
path). Also adds cmdpath parameter
- Fix permissions on private key (604 was a typo)
- Add "Managed by puppet" header

2014-10-15 Release 1.1.0
Features:
- Added eyaml, eyaml_datadir, & eyaml_extension parameters to hiera class for configuring hiera-eyaml
Expand Down
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'hunner-hiera'
version '1.1.0'
version '1.1.1'
source 'UNKNOWN'
author 'hunner'
license 'BSD'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Hiera Puppet

[![Puppet Forge](http://img.shields.io/puppetforge/v/hunner/hiera.svg)](https://forge.puppetlabs.com/hunner/hiera)
####Table of Contents

1. [Overview](#overview)
Expand Down
25 changes: 15 additions & 10 deletions manifests/eyaml.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
#
class hiera::eyaml (
$provider = $hiera::params::provider,
$owner = $hiera::params::owner,
$group = $hiera::params::group,
$cmdpath = $hiera::params::cmdpath,
$confdir = $hiera::params::confdir
$owner = $hiera::owner,
$group = $hiera::group,
$cmdpath = $hiera::cmdpath,
$confdir = $hiera::confdir
) inherits hiera::params {

package { 'hiera-eyaml':
Expand All @@ -33,19 +33,24 @@
exec { 'createkeys':
user => $owner,
cwd => $confdir,
command => "${cmdpath}/eyaml createkeys",
command => 'eyaml createkeys',
path => $cmdpath,
creates => "${confdir}/keys/private_key.pkcs7.pem",
require => Package['hiera-eyaml'],
}

$eyaml_files = [
"${confdir}/keys/private_key.pkcs7.pem",
"${confdir}/keys/public_key.pkcs7.pem"]

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

file { "${confdir}/keys/public_key.pkcs7.pem":
ensure => file,
mode => '0644',
owner => $owner,
group => $group,
require => Exec['createkeys'],
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
# Note: You need to manage any package/gem dependancies
# Default: native
#
# [*cmdpath*]
# Search paths for command binaries, like the 'eyaml' command.
# The default should cover most cases.
# Default: ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin']
#
# === Actions:
#
# Installs either /etc/puppet/hiera.yaml or /etc/puppetlabs/puppet/hiera.yaml.
Expand Down Expand Up @@ -104,6 +109,7 @@
$eyaml_extension = $hiera::params::eyaml_extension,
$confdir = $hiera::params::confdir,
$logger = $hiera::params::logger,
$cmdpath = $hiera::params::cmdpath,
$merge_behavior = undef,
$extra_config = '',
) inherits hiera::params {
Expand Down
3 changes: 1 addition & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
$owner = 'pe-puppet'
$group = 'pe-puppet'
$provider = 'pe_gem'
$cmdpath = '/opt/puppet/bin'
$confdir = '/etc/puppetlabs/puppet'
} else {
$hiera_yaml = '/etc/puppet/hiera.yaml'
$datadir = '/etc/puppet/hieradata'
$owner = 'puppet'
$group = 'puppet'
$provider = 'gem'
$cmdpath = '/usr/bin/puppet'
$confdir = '/etc/puppet'
}
$cmdpath = ['/opt/puppet/bin', '/usr/bin', '/usr/local/bin']
$datadir_manage = true
$backends = ['yaml']
$logger = 'console'
Expand Down
1 change: 1 addition & 0 deletions templates/hiera.yaml.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# managed by puppet
---
:backends:
<% if @eyaml
Expand Down