Giter Club home page Giter Club logo

puppetupdate's Introduction

puppetupdate

Git branches => Puppet environments, automated with an mcollective agent

Usage

The puppetupdate agent will then pull your puppet code and checkout /etc/puppet/environments/xxx for each branch that you have, giving you an environment per branch.

This means that you can develop puppet code independently on a branch, push, mco puppetupdate and then puppet agent -t --environment xxxx on clients to test (where the environment maps to a branch name)

Branch name rewriting.

There are a selection of environment names which are not permitted in puppet.conf, these are:

  • master
  • user
  • agent
  • main

If you have a branch named like this, then puppetupdate will automatically append 'branch' to the name, ergo a branch in git named 'master' will become an environment named 'masterbranch'.

Additionally, there are a selection of characters which whilst being valid git branch names, are not valid puppet environment names.

Notably, the following characters get translated:

  • - becomes _

  • / becomes __

Configuration

The following configuration options are recognised in the mcollective server.cfg, under the namespace plugin.puppetupdate.xxx

ssh_key

An ssh key to use when pulling puppet code. Note that this key must NOT have a passphrase.

directory

Where you keep your puppet code, defaults to /etc/puppet

Environments are always under this directory, as is the checkout of your puppet code (in a directory named puppet.git)

repository

The repository location from which to clone the puppet code.

Defaults to http://git/puppet

You almost certainly want to change this!

ignore_branches

A comma separated list of branches to not bother checking out (but not remove if found).

Defaults to empty.

Often you want to set this to 'production', so that you can symlink the default branch to puppet client to whatever your default git branch is called (unless you name your default git branch 'production')

If any of the entries are bracketed by //, then the value is assumed to be a regular expression.

For example, the setting:

production,/^foobar/

will ignore the 'production' branch, and also any branch prefixed with 'foobar'

remove_branches

A comma separated list of branches to never checkout, and remove if found checked out.

Value behaves in the same manor as ignore_branches

run_after_checkout

If set, after checking out / updating a branch then puppetupdate will chdir into the top level /etc/puppet/environments/xxx directory your branch has just been checked out into, and run the command configured here.

Use this to (for example) decrypt secrets committed to your puppet code using a private key only available on puppet masters.

Installation

Checkout, then just run:

mco plugin package .

You'll get a .deb or .rpm of the code for this agent, which you can install on your puppet masters.

Arrange your puppet.conf on your puppetmaster to include the $environment variable, in the modulepath and manifest settings.

LICENSE

MIT licensed (See LICENSE.txt)

Contributions

Patches are very welcome!

puppetupdate's People

Contributors

mks-m avatar bobtfish avatar adamgibbins avatar kmosher avatar

Stargazers

Suraj Biyani avatar Christian Wolff avatar Vamsee Kanakala avatar Satish Puranam avatar Marko Locher avatar Jaco Engelbrecht avatar kyzh avatar  avatar Dan Schaefer avatar Ilya Dmitrichenko avatar

Watchers

Jeffrey Fredrick avatar Ryan Alexander avatar  avatar Brian Roberts avatar  avatar  avatar Joe Schmetzer avatar Francesco Gigli avatar PK Søreide avatar Fred Hatfull avatar Waseem Taj avatar Alex Conlin avatar James Cloos avatar Marc avatar  avatar Shafeen Tejani avatar  avatar Ronny Forberger avatar  avatar  avatar Richard Pearce 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.