Skip to content

Instantly share code, notes, and snippets.

View ody's full-sized avatar

Cody Herriges ody

  • Puppet Labs
  • Oregon, United States of America
View GitHub Profile
@ody
ody / gist:824195
Created February 12, 2011 22:27
Bad idea?
class params {
$foo = 'bar'
}
define blort() {
include params
notify{ $name: message => $params::foo }
}
blort { 'works?': }
ody@orihime:[stomp-irb]% ruby stomp-irb -s localhost --port 61613 -u guest -P guest
Interactive Ruby shell for STOMP
Type 'help' for usage instructions
ruby-1.8.7-p334 :001 > subscribe :topic, 'foo'
Current Subscriptions:
/topic/foo
=> nil
ruby-1.8.7-p334 :003 > topic 'foo', 'hello'
Sent hello to /topic/foo
=> nil
ruby-1.8.7-p334 :004 > topic 'foo', 'hello'
<<stomp>> hello
Sent hello to /topic/foo
=> nil
ruby-1.8.7-p334 :005 > topic 'foo', 'hello'
<<stomp>> hello
Sent hello to /topic/foo
@ody
ody / gist:866485
Created March 11, 2011 20:13
mca vim snippet.
snippet mca
module MCollective
module Agent
class ${1:Agentname}<RPC::Agent
metadata
:name => "${2:agentname}",
:description => "Performs $2 actions",
:author => "${3:myname}",
:license => "${4:BSD}",
:version => "${5:0.0.1}",
@ody
ody / gist:979893
Created May 19, 2011 00:15
Ruby 1.9.2 puppet cert failure.
HEAD is now at fc0add1... Updated CHANGELOG for 2.7.0rc3
ody@orihime:[puppet]% rvm use 1.9.2
Using /Users/ody/.rvm/gems/ruby-1.9.2-p180
ody@orihime:[puppet]% envpuppet puppet cert --list
Could not parse options: wrong number of arguments (1 for 0)
user { 'bob':
ensure => present,
}
user { 'isntbob':
ensure => absent,
name => 'bob',
}
user { 'isbob':
ensure => present,
name => 'bob',
}
user { 'isntbob':
ensure => absent,
name => 'bob',
}
vhost { 'dashboard': ensure => present }
Package <| name == 'passenger' |> -> Vhost['dashboard']
vhost { 'dashboard': ensure => present }
Package['passenger'] -> Vhost['dashboard']
@ody
ody / gist:1043221
Created June 23, 2011 18:36
Stumped.
[root@puppetmaster01 ~]#
[root@puppetmaster01 ~]# /opt/puppet/bin/irb
irb(main):001:0> require 'puppet'
=> true
irb(main):002:0> Process::UID.change_privilege(102)
=> 102
irb(main):003:0> require 'puppet/network/server'
LoadError: no such file to load -- puppet/network/server
from /opt/puppet/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/puppet/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'