Skip to content

Instantly share code, notes, and snippets.

View jeffmccune's full-sized avatar

Jeff McCune jeffmccune

View GitHub Profile
@jeffmccune
jeffmccune / puppet_31.md
Last active December 10, 2015 22:59
Puppet 3.1.0 RC1 Exploratory Testing

Trying to make sure Issue 15165 isn't still an issue and I ran into this:

I'm using: puppetlabs-release-devel-6-1.noarch

root@pe-centos6:/etc/yum.repos.d# yum install puppet
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
@jeffmccune
jeffmccune / activity_report.thor
Created December 17, 2012 23:22
Simple script to process recent activity in redmine, e.g. the data listed at http://projects.puppetlabs.com/issues?query_id=304
require 'rubygems'
require 'thor'
require 'csv'
class ActivityApp < Thor
desc "list FILE", "report on activity given a CSV file from redmine"
# e.g. the report at http://projects.puppetlabs.com/issues?query_id=304
def list(file)
# Issue ID, Project, Tracker, Status, Subject, Target version, Updated
rows = Array.new
@jeffmccune
jeffmccune / what_i_did.md
Created December 4, 2012 06:22
What I did to separate out the boards

Intent

This is in case I fsck up. Knowing what I did is important if I need to undo this.

Steps

  1. Copied the existing board to a new board.
  2. Deleted the pull request column from the existing board.
@jeffmccune
jeffmccune / site.pp
Created November 26, 2012 21:18
passwordless_login_example.pp
node default {
file { '/home/jeff/.ssh/authorized_keys':
content => "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzlnWpbiDfBLJWWh3xEIMo3QJhB+/TucyWtqTB3B3np1LHi7/zJW9L5KwqgCPfcCSPKY4ekW4K5DwZgXufM74+acBJqAIioJby5AVlkYtRMuJItzRYfkClN0Ex/8rCc/y8T+Wa5Q7Kyy73312xxqbeO8nzNkDO2Zx2oxxHVDSeThX5+Tk1lFj3LpsWbuTsImK9KsVPX50M6uNQxSt4ASx0SDe0MDLC5uzbGYtjqkZQYEYguo7O64t81+C3JK3BHDPsL5G5H7g2qwPJ7ola1sV1wDCGE9ago09QZvYpOacPbtbesFhbwKP31eDz2PWGSJ4DCIoLKhmfpEuDpiih649VQ== [email protected]\n",
mode => 0644,
}
}
@jeffmccune
jeffmccune / variable_test.md
Created November 20, 2012 18:27
Variable resolution

Top scope

$ puppet apply -e '$foo = "foovar"
class foo { $var = "in the class" }
include foo
notice "foo is ${::foo}"'
Scope(Class[main]): foo is foovar
@jeffmccune
jeffmccune / jeff_187_voltron.md
Created November 19, 2012 22:26
Jeff's 1.8.7 Voltron

Voltron for Puppet 2.7 and Ruby 1.8.7

$ rake
 * Ruby (MRI)               1.8.7  2012-02-08 patchlevel 358 i686-darwin12.0.0
 * puppet                   2.7.x  2.7.20-rc1                1d01f2a          
 * facter                   1.6.x  1.6.14-20-gd8a4a69        d8a4a69          
 * hiera                    master 1.1.1-2-g198edf4          198edf4          
 * rspec-puppet             master v0.1.5                    695b9a4          
 * puppetlabs_spec_helper   master 0.3.0-3-gdf3b021          df3b021          

Here are my versions. rake spec should work fine with Ruby 1.9 and Puppet 2.7.

$ rake voltron
(in /workspace/puppet-3.x)
 * Ruby (MRI)               1.9.3p194                                                          2012-04-20 revision 35410 x86_64-darwin12.1.0
 * puppet                   2.7.x                                                              2.7.20-rc1                1d01f2a            
 * facter                   alexharv074-ticket/1.6.x/11612_bug_fix_for_HPUX_network_and_others 1.6.14-rc1-5-gb909877     b909877            
 * hiera                    master                                                             1.1.1-2-g198edf4          198edf4            
 * rspec-puppet             master                                                             v0.1.5                    695b9a4            
@jeffmccune
jeffmccune / plan.md
Created November 15, 2012 15:25
~jeff/.plan

Yesterday I

  • Setup HipChat (Took longer than expected. I tried Adium first, the UX was terrible. I'm on the AIR client now, it's not too bad.)
  • Merged #17492 (--run_mode user vs. --run_mode=user)
  • Intended to do, but did not work on #15837 (bugfix for mount type with options on Linux)

Today I plan to

@jeffmccune
jeffmccune / confdir.md
Created November 7, 2012 23:52
Error converting value for param 'manifest': could not find value for param 'manifestdir': could not find value for param 'confdir'

Error:

$ irb
Welcome to IRB. You are using ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]. Have fun ;)
>> require 'puppet' #=> true
>> node     = Puppet::Node.new('localhost') #=> #<Puppet::Node:0x007fc1c4926228 @name="localhost", @classes=[], @parameters={}, @facts=nil, @time=2012-11-07 15:50:47 -0800>
>> compiler = Puppet::Parser::Compiler.new(node)
Puppet::Error: Could not parse for environment production: Error converting value for param 'manifest': Error converting value for param 'manifestdir': Could not find value for $confdir
 from /workspace/puppet-3.x/src/puppet/lib/puppet/settings.rb:253:in `block in convert'
$ which git_branch
git_branch () {
local ref=$(git symbolic-ref HEAD 2> /dev/null)
local branch=${ref#refs/heads/}
echo $branch
}