Code Monkey home page Code Monkey logo

puppet-extlookup's Introduction

What?

A version of extlookup with a pluggable backend. The same puppet manifests can be configured to query different backends like a backward compatible CSV file, YAML files or in-module data.

Configuration?

You need a YAML file called extlookup.yaml in the same directory as your puppet.conf it looks like the examples below

Parsers?

CSV

Compatible with old extlookup, all the feature of the old extlookup and supports config using the old global variables and if those don't exist the new config file

To configure just set :datadir to a directory full of files ending in .csv

   ---
   :parser: CSV
   :precedence:
   - environment_%{environment}
   - common
   :csv:
      :datadir: /etc/puppet/extdata

This configures the function to look in a per environment CSV file and then in a common one. Files are stored in /etc/puppet/extdata

This is equivelant to the old config:

$extlookup_datadir = "/etc/puppet/extdata"
$extlookup_precedence = ["environment_%{environment}", "common"]

YAML

A YAML parser that supports the same precedence and overrides. For simple String data it will do variable parsing like the old CSV extlookup but if you put a hash or arrays of hashes in your data it wont touch those.

---
:parser: YAML
:precedence:
- environment_%{environment}
- common
:yaml:
   :datadir: /etc/puppet/extdata

This configuration matches the above CSV configuration, all you need to do is create yaml files instead of CSV files.

Both (YAML and CSV) support variables also in the datadir option, so that for example you are able to point puppet to different datadirs depending on the current environment:

[...]
:yaml:
    :datadir: /etc/puppet/environments/%{environment}/extdata

Puppet

A parser that reads values from Puppet manifests inspired by Nigel Kerstens get() function. Without configured precedence the behavior of this backend will be identical to the get() function

In addition to the simple features of the get() function it also includes full precedence in line with the extlookup features.

For details of the precedence behavior for this backend see the comments top of the backend.

You can also configure explicit behavior like proposed by Nigel:

---
:parser: Puppet
:precedence:
- %{calling_class}
- %{calling_module}
:puppet:
   :datasource: data

Status?

This is a work in progress, use at your own risk

Contact?

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

puppet-extlookup's People

Contributors

duritong avatar jamtur01 avatar jordansissel avatar ripienaar avatar vinzent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-extlookup's Issues

Move 'util' into rubygem?

I'd like for this project to not reimplement what extlookup already does; I'd like to use the libs already provided here

Project that should die: https://github.com/jordansissel/extlookup.rb

What would help me here is having the util/parser libs here pushed into a rubygem (perhaps published/released in parallel, not required to be a separate dependency for the puppet function)

Thoughts?

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.