Skip to content

Instantly share code, notes, and snippets.

@tfhartmann tfhartmann/
Last active Dec 20, 2015

What would you like to do?
POC Notes for Puppet

Put this in it's own deployment repo (branchs for differt types of server i.e. front end, app server etc)

Needs a patch for db_server param in the puppet-mediawiki module

4 basic files

  1. "yamilifier" script that pulls env vars into hierra
  2. single shell script with standard name (
  3. Puppetfile
  4. init.pp or X number of of manifests

Things to add to the dev box

  1. Cron job that runs puppet in noop mode and emails the dev any changes it would have made (safetynet)

This comment has been minimized.

Copy link

commented Aug 8, 2013

so, this is totally a hack, but it'll do for an env-to-yaml extractor:


require 'yaml'

# parse args to determine env var prefix
default_prefix = 'NEPHO_'
prefix = default_prefix
ARGV.each_with_index {|arg, i| arg =~ /^(-p|--prefix)$/ && prefix = ARGV[i + 1]}
prefix || prefix = default_prefix

# extract env vars matching prefix and put them in a hash
extracted = {} {|key, value| key =~ /^#{prefix}/}.each {|pair| extracted[pair[0]] = pair[1]}

# emit the hash
puts extracted.to_yaml

This comment has been minimized.

Copy link

commented Aug 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.