Skip to content

Instantly share code, notes, and snippets.

@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|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDYTZfCvoPtus3vMMl0AS8a6K3OPZijMxiuiGD23ySUv14TIm+Azrzav+gH1BTDdnpK6/aQBzo5UEQwKCXxdpdV6s4OHEyLcCvUPm3fAe4Idy7iNtX+UmtumsAqMRovN+T8PAGqe0NOUC9Qq0+zDyH+qz0D44rPAIFs54EpCRq4hpvRHh5Oqy9nb6dYzW94HagDtPga2GeqqPdyhZD9gngsv0uOMWLhbF67S8No1oY6V3GaEelzZr2lLy/86k3kTbOuT1iWRJsKcjwuv0Ikwz3UeZcF1m6PrY3V6Qz9lh9CwrP464SlZ9GzqM4OKB1pPrCetUGKlcX2c3nUIV/x/iOP justin@allstaff
test_name "Installing Puppet and vcsrepo module" do
step 'install puppet' do
if @options[:provision]
# This will fail if puppet is already installed, ie --no-provision
if hosts.first.is_pe?
install_pe
else
install_puppet
end
end
@justinstoller
justinstoller / jenkins-slave.sh
Created July 18, 2014 19:57
basic init script
#!/bin/sh
#
# /etc/init.d/jenkins-slave
# init script for Jenkins Slave Swarm Client.
#
# chkconfig: 2345 90 60
# description: Jenkins Slave Swarm Client
#
RETVAL=0
require 'spec_helper_acceptance'
describe 'just to make the setup code run' do
it { true }
end
require 'spec_helper_acceptance'
describe 'a basic test' do
it 'does very little' do
puppet_run = apply_manifest("notify {'Hello Bar': }", :catch_failures => true)
expect(puppet_run.stdout).to include('Hello Bar')
end
end
legacy_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_VERSION'] || '3.8.1'),
}
aio_opts = {
:default_action => 'gem_install',
:version => (ENV['PUPPET_AGENT_VERSION'] || '1.1.0'),
}
@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 / example.txt
Last active February 12, 2019 00:27
profiling server responding to catalog request in repl
sellout:puppetserverspike justin$ lein with-profile +yk9k irb
Using 1G min heap since not set via PUPPETSERVER_HEAP_SIZE environment variable or user.puppetserver-heap-size in ~/.lein/profiles.clj file. Set to at least 5G for best performance during test runs.
Using 2G max heap since not set via PUPPETSERVER_HEAP_SIZE environment variable or user.puppetserver-heap-size in ~/.lein/profiles.clj file. Set to at least 5G for best performance during test runs.
[YourKit Java Profiler 2017.02-b66] Log file: /Users/justin/.yjp/log/main-78581.log
irb(main):001:0> load './puppet_server_helper.rb'
WARN: Unresolved specs during Gem::Specification.reset:
gettext (>= 3.0.2)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.