Code Monkey home page Code Monkey logo

puppet-noah's Introduction

puppet-noah

Description

A collection of Puppet bits and pieces for working with Noah (https://github.com/lusis/noah)

Requirements

  • Noah
  • puppet

Installation

Install puppet-noah as a module in your Puppet master's module path. You then need to use pluginsync to sync the functions and fact onto your master.

To use the ENC you can copy the ENC script to somewhere appropriate and enable external node configuration in your Puppet master's puppet.conf configuration file.

Usage

ENC

The module contains an ENC (External Node Classifier) for Noah in bin/noah_enc. The ENC connecs to a Noah server and returns node classification data. It connects either to a hard-coded Noah URL (defaulting to http://localhost:9292) which you can change in the ENC or override by setting the NOAH_URL environmental variable.

The ENC queries the hosts defined on a Noah server via the Host API and returns a list of classes based on services defined on that host, for example if the host has the services mysql and redis then the ENC will return the classes:

  • mysql
  • redis

See information on ENC's here

The noah_get function

The noah_get function returns data from a Noah instance. It can use the Host, Service, Configuration and Application APIs to do this. It requires the rest-client gem to work correctly:

$ gem install rest-client

You can call the function like so by specifying the URL, the type of data, and the name of the data item being returned:

$foo = noah_get("http://localhost:9292", host, bar)

This will return data about the bar host in the form of a hash and assign it to the variable $foo. The function accepts the following data types:

  • host
  • application
  • service
  • configuration

You can see the full list of applicable APIs here.

The noah_put function

The noah_put function sends data to a Noah server. It can use the Host, Service, Configuration and Application APIs to do this (although its use of the Service and Configuration API is currently somewhat limited). It requires the rest-client gem to work correctly:

$ gem install rest-client

You can call the function like so by specifying the URL, the type of data, and the data being sent:

noah_put("http://localhost:9292", host, up)

This will create a host named using the value of the fqdn fact with a status of up (valid statuses are up or down).

You can also create a new application:

noah_put("http://localhost:9292", application, foo)

This will create a new application called foo on the Noah server.

You can create a new service:

noah_put("http://localhost:9292", service, mysql)

This will create a new service called mysql with a status of up. As yet you can't control the service or host status of the service being created.

Or you can create configuration items:

noah_put("http://localhost:9292", configuration, bar)

This creates a configuration item called bar with a format of string and a value of bar. Further work is needed to extend this to support the full set of naming and data types avaialble. Consider this an MVP.

Noah facts

The noah_data fact connects to the Noah server and returns all of the configurations items via the Configuration API as fact values. As Facter currently only supports strings as fact values this means some data isn't yet in an ideal format.

Author

James Turnbull [email protected]

License

Author:: James Turnbull (<[email protected]>)
Copyright:: Copyright (c) 2011 James Turnbull
License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

puppet-noah's People

Contributors

jamtur01 avatar ilyash avatar

Stargazers

Alfonso Gonzalez avatar Jason Edgecombe avatar Eslam Elhusseiny avatar Lars Fronius avatar Martin Jackson avatar John E. Vincent avatar Cody Robertson avatar Andrew Forgue avatar Jeremy Pruitt avatar Matthias Viehweger avatar ben lovett avatar Adam Gibbins avatar Jude N avatar Gus Becciu avatar Joe Block avatar  avatar Elmer Rivera avatar  avatar

Watchers

 avatar Matthias Viehweger avatar John E. Vincent avatar James Cloos avatar

Forkers

lusis ilyash

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.