Skip to content

Instantly share code, notes, and snippets.

@justinstoller
justinstoller / .gitignore
Created March 6, 2012 06:37 — forked from aussielunix/.gitignore
jenkins configs to github
#
# The following ignores...
# Miscellaneous Jenkins litter
*.log
*.tmp
*.old
*.bak
*.jar
*.json
activemodel (3.0.7)
activerecord (3.0.7)
activesupport (3.0.7)
arel (2.0.10)
builder (2.1.2)
cgi_multipart_eof_fix (2.5.0)
columnize (0.3.4)
couchrest (1.0.2)
daemons (1.1.3)
diff-lcs (1.1.3)
require 'spec_helper'
let(:defaults) do
{ 'owner' => 'root', 'group' => 'root' }
end
describe 'scott_test' do
it do should contain_file('foo', 'bar', 'baz').with(
{ 'ensure' => 'present' }.merge(defaults)
) end
require 'rubygems'
require 'rubygems/package_task'
Dir['tasks/**/*.rb'].each { |t| load t }
spec = Gem::Specification.new do |s|
s.name = "hiera-json"
s.version = described_version
s.author = "Puppet Labs"
s.email = "info@puppetlabs.com"
@justinstoller
justinstoller / smf_prop.pp
Last active December 11, 2015 16:48
An example smf property defined type (I don't remember if it works...)
#
# This provides simple setting of smf service properties idempotently
# Usage:
# smf_prop { 'application/pkg/server pkg/port=blah': }
#
# Example (from my defunct ips repo manifest
# Smf_prop {
# notify => Service[ $service ],
# require => Exec[ "create-pkgrepo-${path}" ],
# }
test_name "Basic AIX Package Provider" do
# AIX Provider only should run on AIX machines
confine :to, :platform => /aix/
agents.each do |agent|
# Test variables
package = 'sudo.rte'
version1 = '1.7.10.4'
@justinstoller
justinstoller / blah.rb
Created September 26, 2013 16:57
QE-245
# Attempt to debug https://github.com/hunner/puppetlabs-haproxy/blob/beaker/spec/acceptance/single_node/basic_spec.rb
# Using the default TestUnit assertions. This all passes locally.
# I've included commented out failing cases to show the converse,
# including the result reported in the final test summary
test_name "let's experiment" do
step "test on and friends yield symantics" do
my_manifest = %q{
notify { 'blah': }
⭑ cat Vagrantfile
Vagrant.configure("2") do |c|
c.vm.define 'centos-6-x86-64-master' do |v|
v.vm.hostname = 'centos-6-x86-64'
v.vm.box = 'centos-6-x64-vbox4210'
v.vm.box_url = 'http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box'
v.vm.base_mac = '080027B17046'
v.vm.network :private_network, ip: "10.255.27.85", :netmask => "255.255.0.0"
end
c.vm.define 'centos-6-x86-64-agent' do |v|
@justinstoller
justinstoller / gist:f57e64b78ed568c52c08ef12a170dec3
Last active November 10, 2017 17:04
dependency cycle with pdb
Seeing this failure when tring to install PDB via the module on Debian 9:
cy21od14dqt4842.delivery.puppetlabs.net (debian9-64-1) executed in 4.38 seconds
RuntimeError: PuppetAcceptance::DSL::Helpers.with_puppet_running_on failed (check backtrace for location) because: Host 'cy21od14dqt4842.delivery.puppetlabs.net' exited with 1 running:
puppet agent --test --server cy21od14dqt4842.delivery.puppetlabs.net
Last 10 lines of output were:
Notice: /File[/opt/puppetlabs/puppet/cache/lib/puppet_x]/ensure: created
Notice: /File[/opt/puppetlabs/puppet/cache/lib/puppet_x/apt_key]/ensure: created
Notice: /File[/opt/puppetlabs/puppet/cache/lib/puppet_x/apt_key/patch_openuri.rb]/ensure: defined content as '{md5}951bad007a3b5db035be069c1d1c9c09'
@justinstoller
justinstoller / clean.rb
Last active December 13, 2017 00:10
Misc when using the Puppet Profiler
#!/usr/bin/env ruby
def clean_profile_line(line)
if line =~ /.*\[(\d+)\] (\d(\.\d\d?)*) (.*): took (\d*\.?\d*) seconds/
request_id = $1
step_and_maybe_substeps = $2
# unused artifact of the regex, named here for documentation purposes
maybe_substeps = $3
step_name = $4