Forge Home

hiera_createresource

create puppet resources with a single hiera call

9,236 downloads

9,099 latest version

3.8 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.1.1 (latest)
  • 0.1.0
released Sep 29th 2014

Start using this module

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

Add this module to your Puppetfile:

mod 'ajaz-hiera_createresource', '0.1.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ajaz-hiera_createresource
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ajaz-hiera_createresource --version 0.1.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

ajaz/hiera_createresource — version 0.1.1 Sep 29th 2014

hiera_createresource

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Usage - Configuration options and additional functionality
  4. Contributing - Guide for contributing to the module

Overview

create puppet resources with a single hiera call

Module Description

this module installs hiera_class and hiera_define via autoload

  • hiera_class create a new class resource from a hash with the given name in hiera
  • hiera_define creates multible resources from by readinf a hash with tow layes in hiera

Usage

hiera_class("name")

create a class from a hiera hash

  • hash in hiera ( common.yaml)
      openldap::client:
          uri: '_ldap._tcp.example.com'
          base: 'dc=exampl,dc=com'
          ssl_cert: '/etc/ssl/certs/ca-certificates.crt'
          ssl_reqcert: 'hard'
      
    
  • code in site.pp
      node default {
          hiera_class('openldap::client')
      }
      
    

hiera_define("name")

  • create defined class from hiera hash

      bind9::record::a:
          _ldap:
              zone: '_ldap.example.com'
              data:
                  - '10.0.0.3'
              ptr: true
          dc01:
              zone: 'example.com'
              data:
                  - '10.0.0.3'
              ptr: true
    
  • code in site.pp

      node default {
          hiera_define('bind9::record::a')
      }
    

Contributing

  1. Fork it

  2. Create your feature branch

    git checkout -b my-new-feature`
    
  3. Commit your changes

    git commit -am 'Added some feature'
    
  4. Push to the branch

    git push origin my-new-feature
    
  5. Create new Pull Request