Forge Home

hierabackend

Perform lookups on specific backends.

10,334 downloads

10,334 latest version

3.5 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.1 (latest)
released Nov 5th 2012

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'crayfishx-hierabackend', '0.0.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add crayfishx-hierabackend
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install crayfishx-hierabackend --version 0.0.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

crayfishx/hierabackend — version 0.0.1 Nov 5th 2012

Puppet module: hiera_backend

Intro

hiera_backend provides a couple of functions for querying and determining a specific hiera backend to use for a search. It is mostly useful for people running multple back ends but do not always want to cycle through the list of configured backends, but rather, target one in particular.

This is not intended as a permenant solution, I hope that there is a nicer more elegant way of accomplishing this in hiera-2.0.0 but until then this will provide a way of doing per-backend queries for sites running more than one backend.

Examples

# If we have GPG, insist we use it
if hiera_has_backend('gpg') {
  $password = hiera_backend('gpg', 'password')
}


# Assume we have yaml, mysql configured, but want to search in reverse
$foo = hiera_has_backend('mysql') ? {
  true  => hiera_backend('mysql', 'foo'),
  false => hiera('foo')
}

Functions

  • hiera_has_backend(<backend>) : returns true or false
  • hiera_backend(<backend>, <query>, [<default>[<override>]])