Giter Club home page Giter Club logo

puppet-module-data's Introduction

What?

NOTE: There is now native support for this feature in Puppet 4 and this repo is now officially deprecated and moving to unmaintained.

Additionally this module does not work on Puppet 4, will likely break your setup. Do not use it on Puppet 4, migrate to native Module Data support

See https://www.devco.net/archives/2016/01/08/native-puppet-4-data-in-modules.php

While hiera does a decent job of separating code and data for users it is quite difficult for module authors to use hiera to create reusable modules. This is because the puppet backend is optional and even when it is loaded the module author cannot influence the hierarchy.

With this commit we add a new module_data backend that loads data from within a module and allow the module author to set a hierarchy for this data.

The goal of this backend is to allow module authors to specify true module default data in their modules but still allow users to override the data using the standard method - especially useful with the puppet 3 hiera integration.

This backend is always loaded as the least important tier in the hierarchy - unless a user choose to put it somewhere specific, but this backend will always be enabled.

Given a module layout:

your_module
├── data
│   ├── hiera.yaml
│   └── osfamily
│       ├── Debian.yaml
│       └── RedHat.yaml
└── manifests
    └── init.pp

The hiera.yaml is optional in this example it would be:

---
:hierarchy:
- osfamily/%{::osfamily}
- common

But when no hiera.yaml exist in the module, the default would be:

---
:hierarchy:
- common

The data directory is then a standard Hiera data store.

Status?

This is but a first stab at turning my old pull request for ticket 16856 into a standalone module that any > 3.0.0 Puppet user can depend on to get this essential feature.

Some more testing is needed, sanity checking for support versions etc so consider this a early feedback-saught release

Contact?

R.I.Pienaar / [email protected] / @ripienaar / http://devco.net

puppet-module-data's People

Watchers

 avatar  avatar

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.