Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the pretty pretty documents. #3

Merged
merged 2 commits into from
Jun 17, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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