Showing with 107 additions and 4 deletions.
  1. +4 −0 CHANGELOG
  2. +1 −1 Modulefile
  3. +0 −3 README
  4. +32 −0 README.md
  5. +55 −0 manifests/init.pp
  6. +15 −0 manifests/params.pp
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2013-06-17 Release 0.3.1
Bugfixes:
- Docs!

2013-06-17 Release 0.3.0
Features:
- PE + POSS support
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 '0.3.0'
version '0.3.1'
source 'UNKNOWN'
author 'hunner'
license 'BSD'
Expand Down
3 changes: 0 additions & 3 deletions README

This file was deleted.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Hiera Puppet

## Description
This module configures [Hiera](https://github.com/puppetlabs/hiera) for Puppet.

## Usage
This class will write out a hiera.yaml file in either /etc/puppetlabs/puppet/hiera.yaml or /etc/puppet/hiera.yaml (depending on if the node is running Puppet Enterprise or not).

```puppet
class { 'hiera':
hierarchy => [
'%{environment}/%{calling_class}',
'%{environment}',
'common',
],
}
```

The resulting output in /etc/puppet/hiera.yaml:
```yaml
---
:backends: - yaml
:logger: console
:hierarchy:
- "%{environment}/%{calling_class}"
- "%{environment}"
- common

:yaml:
:datadir: /etc/puppet/hieradata
```
55 changes: 55 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# == Class: hiera
#
# This class handles installing the hiera.yaml for Puppet's use.
#
# === Parameters:
#
# [*hierarchy*]
# Hiera hierarchy.
# Default: empty
#
# [*hiera_yaml*]
# Heira config file.
# Default: auto-set, platform specific
#
# [*datadir*]
# Directory in which hiera will start looking for databases.
# Default: auto-set, platform specific
#
# [*owner*]
# Owner of the files.
# Default: auto-set, platform specific
#
# [*group*]
# Group owner of the files.
# Default: auto-set, platform specific
#
# === Actions:
#
# Installs either /etc/puppet/hiera.yaml or /etc/puppetlabs/puppet/hiera.yaml.
# Links /etc/hiera.yaml to the above file.
# Creates $datadir.
#
# === Requires:
#
# Nothing.
#
# === Sample Usage:
#
# class { 'hiera':
# hierarchy => [
# '%{environment}',
# 'common',
# ],
# }
#
# === Authors:
#
# Hunter Haugen <h.haugen@gmail.com>
# Mike Arnold <mike@razorsedge.org>
#
# === Copyright:
#
# Copyright (C) 2012 Hunter Haugen, unless otherwise noted.
# Copyright (C) 2013 Mike Arnold, unless otherwise noted.
#
class hiera (
$hierarchy = [],
$hiera_yaml = $hiera::params::hiera_yaml,
Expand Down
15 changes: 15 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# == Class: hiera::params
#
# This class handles OS-specific configuration of the hiera module. It
# looks for variables in top scope (probably from an ENC such as Dashboard). If
# the variable doesn't exist in top scope, it falls back to a hard coded default
# value.
#
# === Authors:
#
# Mike Arnold <mike@razorsedge.org>
#
# === Copyright:
#
# Copyright (C) 2013 Mike Arnold, unless otherwise noted.
#
class hiera::params {
if $::puppetversion =~ /Puppet Enterprise/ {
$hiera_yaml = '/etc/puppetlabs/puppet/hiera.yaml'
Expand Down