Skip to content

Instantly share code, notes, and snippets.

View ahpook's full-sized avatar

Eric Sorenson ahpook

View GitHub Profile
@ahpook
ahpook / manifests_site.pp
Last active December 21, 2015 04:58
Containment example
node default {
notify { 'final notice':
message => "this should come last"
} <-
class { 'containers': }
}
[main]
# generic puppet variables
vardir = /var/lib/puppet
ssldir = $vardir/ssl
# .. etc
[master]
# setting for dynamic environments
manifest = /etc/puppet/environments/$environment/manifests/site.pp
modulepath = /etc/puppet/environments/$environment/modules:/etc/puppet/environments/global/modules
Puppet 3.3.0 Release Notes
==========================
For the full list of closed issues specific to 3.3.0 see [this list in
Redmine](http://projects.puppetlabs.com/versions/401), containing 17 new
features, and 67 bugs closed.
New Features
------------
#### #2628: It would be useful if node name regexps set $1
@ahpook
ahpook / data_in_modules.md
Last active December 23, 2015 07:09
Data in Modules hangout notes
09:17 <_rc> using the yaml one is sufficent.
09:18 <_rc> just populate it in a non-dumb manner, profit.
09:18 <code-cat> ugh, puppet is not stellar when it comes to managing cron jobs though
09:18 <tremble> code-cat: What's important is not having to wait for the process to run. Making it totally asynchronous from the mcollective process.
09:19 <code-cat> k
18:00 <jaschal> If puppetcommander is raising an exception "execution expired", is there a setting somewhere I can tweak to increase this timeout? https://gist.github.com/jascha/6894461
18:06 <jaschal> Hmnn... I think the underlying problem is with ActiveMQ: https://issues.apache.org/jira/browse/AMQ-3131
16:58 <Zal> Hi all, woke up today to find that "mco find" on my puppet master suddenly only sees half of our nodes. Any suggestions as to what to check initially?
16:59 <Zal> puppet cert list -all shows all the nodes still active and managed by puppet, so I assume this is something specfic to mco
17:08 <Zal> I've also tried restaring the mcollective daemo
@ahpook
ahpook / hash.rb
Last active August 29, 2015 13:57
#!/usr/bin/env ruby
require 'yaml'
bar = [ { 'key1a' => 'value1_0', 'key1b' => 'value1_1' },
'key2',
'key3',
{ 'key4a' => 'value4_0', 'key4b' => 'value4_1' }
]
#!/usr/bin/env ruby
require 'jira'
require 'pp'
require 'getoptlong'
# default values
username = "gepetto-bot"
password = ENV["GEPETTO_BOT_PASSWORD"]
@ahpook
ahpook / statefile.pp
Last active August 29, 2015 14:19
statefile problem
# problem: the 'statefile' (state.yaml) never cleans up entries
# which USED to be under management but are no longer in the catalog.
# this causes the statefile to grow without cleanup, and there could
# be a bunch of extra work puppet does on intialization that
# could be totally unneeded.
#
# to repro:
# make a bunch of directories
# for a in $(echo {a..z}) ; do mkdir -p /tmp/mydirs/$a/{a..z} ; done
$binaries = ["cfacter", "facter", "hiera", "mco", "puppet", "puppetserver"]
# function call with lambda:
$binaries.each |String $binary| {
file {"/usr/bin/$binary":
ensure => link,
target => "/opt/puppetlabs/bin/$binary",
}
}
@ahpook
ahpook / hyphen_node.pp
Created June 24, 2015 20:17
regexp backrefences in node
[vagrant@glitched sample_pp]$ FACTER_fqdn=des-bwq0t01 puppet apply ./hyphen_node.pp
Notice: Scope(Node[__node_regexp__des-bweqs0-9t0-9]): matched des-bwq
Notice: Compiled catalog for glitched.vmlocal in environment production in 0.30 seconds
Notice: Applied catalog in 0.01 seconds
[vagrant@glitched sample_pp]$ cat hyphen_node.pp
node /(des-bw[eqs])[0-9]t[0-9]+/ {
notice("matched $1")
}