Showing with 31 additions and 10 deletions.
  1. +6 −0 CHANGELOG
  2. +1 −1 Modulefile
  3. +11 −9 manifests/init.pp
  4. +13 −0 manifests/params.pp
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
2013-06-17 Release 0.3.0
Features:
- PE + POSS support

Bugfixes:
- Only ensure datadir if it does not have %{.*}
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 '0.2.1'
version '0.3.0'
source 'UNKNOWN'
author 'hunner'
license 'BSD'
Expand Down
20 changes: 11 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
class hiera(
class hiera (
$hierarchy = [],
$hiera_yaml = '/etc/puppetlabs/puppet/hiera.yaml',
$datadir = '/etc/puppetlabs/puppet/hieradata',
$owner = 'pe-puppet',
$group = 'pe-puppet'
) {
$hiera_yaml = $hiera::params::hiera_yaml,
$datadir = $hiera::params::datadir,
$owner = $hiera::params::owner,
$group = $hiera::params::group
) inherits hiera::params {
File {
owner => $owner,
group => $group,
mode => '0644',
}
file { $datadir:
ensure => directory,
if $datadir !~ /%{.*}/ {
file { $datadir:
ensure => directory,
}
}
# Template uses $hierarchy, $datadir
file { $hiera_yaml:
ensure => present,
content => template('hiera/hiera.yaml.erb'),
}
# Symlink for hiera command line tool
file { "/etc/hiera.yaml":
file { '/etc/hiera.yaml':
ensure => symlink,
target => $hiera_yaml,
}
Expand Down
13 changes: 13 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class hiera::params {
if $::puppetversion =~ /Puppet Enterprise/ {
$hiera_yaml = '/etc/puppetlabs/puppet/hiera.yaml'
$datadir = '/etc/puppetlabs/puppet/hieradata'
$owner = 'pe-puppet'
$group = 'pe-puppet'
} else {
$hiera_yaml = '/etc/puppet/hiera.yaml'
$datadir = '/etc/puppet/hieradata'
$owner = 'puppet'
$group = 'puppet'
}
}