Skip to content

Instantly share code, notes, and snippets.

View jessereynolds's full-sized avatar

Jesse Reynolds jessereynolds

  • Puppet
  • Melbourne, Victoria, Australia
View GitHub Profile
@jessereynolds
jessereynolds / tmux output
Last active June 28, 2016 02:04
puppet agent run failing after regenerating all certificates on monolithic master PE 2016.2
root@master:~ # puppet agent -t
Warning: Unable to fetch my node definition, but the agent run will continue:
Warning: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certif
icate for /CN=master.puppetlabs.vm]
Info: Retrieving pluginfacts
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Failed to generate additional resources using 'eval_generate': SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issuer certificate fo
r /CN=master.puppetlabs.vm]
Error: /File[/opt/puppetlabs/puppet/cache/facts.d]: Could not evaluate: Could not retrieve file metadata for puppe
t:///pluginfacts: SSL_connect returned=1 errno=0 state=error: certificate verify failed: [unable to get local issu
er certificate for /CN=master.puppetlabs.vm]
@jessereynolds
jessereynolds / gist:5ef292b7c72bc7c9ddcd0b3e81c6a9ce
Last active February 21, 2017 08:22
mco r10k no worky on 2016.1.1 installed by zack/r10k

Symptom:

peadmin@pe-201611-master:~$ mco r10k deploy environment production

No request sent, we did not discover any nodes.


Finished processing 0 / 0 hosts in 0.00 ms

Distributed Node Classification in Puppet Enterprise

You have geographically separated puppet masters that need to be semi-autonomous whilst having node classifier groups updated from a central source of truth. But you don't always have a reliable, or fast, connection back to the central point. To spell this out a bit more, you want / need to have the following:

  • a single source of truth for classification that all masters consume.
  • masters able to keep compiling with the latest available classification data even when the wan links are down for a while.
  • avoid doing NC requests over the WAN due to data size, latency, and reliability constraints.
  • the lightest and most reliable distributed puppet architecture possible while maintaining a single source of truth for node classification data.
  • regions to be semi-autonomous, readonly, and update from a central point.
  • be aware of failing updates.
@jessereynolds
jessereynolds / foo.bash
Last active November 2, 2015 07:47
variables in shell documentation eg curl
#!/bin/bash
export SERVER=xyz.example
export PATH='/foo/bar'
curl http://${SERVER}/${PATH}
/Users/jesse/.rbenv/versions/2.1.2/bin/ruby -I/Users/jesse/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/lib:/Users/jesse/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-support-3.1.2/lib /Users/jesse/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.1.7/exe/rspec --pattern spec/\{classes,defines,unit,functions,hosts,integration\}/\*\*/\*_spec.rb --color
.............F.........................................................................................................FFFF....F.....F..F..F..F..FFFF............FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.....FFFFFFFFFFFFFFFF.....FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.
Failures:
1) flapjack::install input validation when the version parameter is not a string should fail
Failure/Error: expect { subject }.to raise_error(Puppet::Error, /false is not a string./)
expected Puppet::Error with message matching /false is not a string./ but nothing was raised
# ./spec/classes/flapjack_install_spec.rb:67:in `block
@jessereynolds
jessereynolds / fix_heartbeat.rb
Created June 15, 2015 04:12
fix heartbeat in all rrd files to 120 seconds
#!/usr/bin/env ruby
# ds[value].minimal_heartbeat = 120
heartbeat = "120"
file = ARGV[0]
info = `rrdtool info '#{file}' | grep minimal_heartbeat`
puts "examining #{file}"
@jessereynolds
jessereynolds / gist:13785d1950a5a52bea9e
Created June 11, 2015 04:57
mtr to hipchat.com 174.129.0.121
My traceroute [v0.85]
Limiting-Factor.fritz.box (0.0.0.0) Thu Jun 11 14:25:36 2015
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. fritz.box 0.0% 22 2.2 1.6 1.3 2.2 0.0
2. lns20.adl2.on.ii.net 0.0% 21 20.4 20.4 19.4 23.7 0.8
3. ???
@jessereynolds
jessereynolds / event_to_alert.md
Last active August 29, 2015 14:21
Flapjack event to alert pipeline

Draft ideas in response to flapjack/flapjack.io#21 ... might generate some separete, more detailed / developer orented documentation from the below...

Things we also need to discuss here:

  • Filters We probably want to discuss the low level of what the filters are each doing, but also describe at a higher level what the main behaviours are of the filters as a whole (some of the "filters" do more than just filter, eg the acknowledgement filter creates unscheduled maintenance). List of filters:
    • acknowledgement
    • base
    • delays
    • ok
  • scheduled_maintenance
@jessereynolds
jessereynolds / mac name resolution.markdown
Created April 27, 2015 05:48
Something screwy is happening in Yosemite's name resolution systems

Sometimes (quite often) I'm unable to access hosts in web browsers. It just happened with http://stats02.syd07.bulletproof.net/ . Ping agrees with Chrome and Firefox that the hostname is unknown:

jesse@Limiting-Factor ~ $ ping stats02.syd07.bulletproof.net
ping: cannot resolve stats02.syd07.bulletproof.net: Unknown host

But using the host command I can do a dns lookup on it just fine:

@jessereynolds
jessereynolds / flapjack-packaging.markdown
Last active August 29, 2015 14:17
flapjack automated package publishing

Flapjack Packaging - automated publishing

  • push a tag to flapjack, or manual run for particular tag
    • for each supported distro
      • build package, test, publish to experimental repo
      • if failure
        • create github issue in omnibus-flapjack
    • unless all builds succeeded
      • exit
  • for each experimental package produced earlier