Forge Home

puppet_hiera_backend

Express Hiera data in Puppet DSL

5,203 downloads

5,203 latest version

4.6 quality score

Version information

  • 0.1.0 (latest)
released Mar 21st 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x
  • Puppet >= 5.0.0 < 6.0.0
  • RedHat
    ,
    CentOS
    ,
    SLES
    ,
    Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'WhatsARanjit-puppet_hiera_backend', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add WhatsARanjit-puppet_hiera_backend
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install WhatsARanjit-puppet_hiera_backend --version 0.1.0

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

WhatsARanjit/puppet_hiera_backend — version 0.1.0 Mar 21st 2018

puppet_hiera_backend

Table of Contents

  1. Overview
  2. Requirements
  3. Configuration
  4. Usage

Overview

Use Puppet DSL to express Hieradata instead of JSON or YAML.

Requirements

  • Puppet >= 5.x.x

Configuration

  • /etc/puppetlabs/puppet/hiera.yaml

    ---
    version: 5
    defaults:
      datadir: data
    hierarchy:
      - name: Experimental Puppet backend
        data_hash: puppet_data
        path: puppet.pp
    
    
  • /etc/puppetlabs/puppet/data/puppet.pp

    {
      'string' => 'foo',
      'array' => [
        'one',
        'two',
        'three',
      ],
      'hash' => {
        'a' => 1,
        'b' => 2,
        'c' => 3,
      }
    }
    

    NOTE: Hiera data file can only contain literals. This prevents intrusive Puppet code. See documentation here.

Usage

[root@master ~]# puppet apply -e 'notice(hiera("string"))'
Notice: Scope(Class[main]): foo
Notice: Compiled catalog for master.puppetlabs.vm in environment production in 0.62 seconds
Notice: Applied catalog in 0.25 seconds
[root@master ~]# puppet apply -e 'notice(hiera("array"))'
Notice: Scope(Class[main]): [one, two, three]
Notice: Compiled catalog for master.puppetlabs.vm in environment production in 0.58 seconds
Notice: Applied catalog in 0.24 seconds
[root@master ~]# puppet apply -e 'notice(hiera("hash"))'
Notice: Scope(Class[main]): {a => 1, b => 2, c => 3}
Notice: Compiled catalog for master.puppetlabs.vm in environment production in 0.65 seconds
Notice: Applied catalog in 0.27 seconds