GithubHelp home page GithubHelp logo

fatmcgav / puppet-hiera_resources Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rnelson0/puppet-hiera_resources

0.0 2.0 1.0 27 KB

Allow arbitrary definition of resources (classes and defined types) via hiera content while avoiding the hiera_hash/create_resources pattern.

Ruby 90.26% Puppet 9.74%

puppet-hiera_resources's Introduction

hiera_resources

Build Status Puppet Forge Puppet Forge Downloads Stories in Ready ![Stories In Progress](https://badge.waffle.io/rnelson0/puppet-hiera_resources.svg?label=in progress&title=In Progress)

Table of Contents

  1. Overview
  2. Beginning with hiera_resources
  3. Usage - Configuration options and additional functionality
  4. Credit

Overview

Allow arbitrary definition of resources (classes and defined types) via hiera content while avoiding the hiera_hash/create_resources pattern.

Beginning with hiera_resources

hiera_resources() allows you to use arbitrary hiera data to create and manage classes and defined types. Provide a hash with a top level name followed by a second level resource type and subsequent levels containing the required resource parameters and values.

For instance, given the following hiera YAML file:

---
messages1:
  notify:
    title 1:
      message: this is the first message stored in YAML
    title 2:
      message: this is the second message stored in YAML

You may include hiera_resources('messages1') in a manifest to create two notify resources, 'title 1' and 'title 2'.

hiera_resources() does not verify the contents of the hash or referenced resource type. It does accept a second value as a default value if the lookup fails, following the same tiered hierarchy as the hiera hash.

Title-only or parameter-less resources can be created by leaving a dangling colon or an empty hash ({}). For example:

----
title-only:
  notify:
    Title and message:
    Title and message with empty hash: {}

Usage

Ensure that hiera_resources is in your $modulepath and that pluginsync is set to true on the master. You may then use hiera_resources() in your manifests.

Credits

This version of hiera_resources is based on this excellent blog post by Robin Bowes and a subsequent refactoring.

Contributions from:

puppet-hiera_resources's People

Contributors

rnelson0 avatar fatmcgav avatar sspreitzer avatar

Watchers

James Cloos avatar  avatar

Forkers

weareact

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.