Skip to content

Instantly share code, notes, and snippets.

View lak's full-sized avatar

Luke Kanies lak

View GitHub Profile
diff --git a/lib/puppet/network/xmlrpc/client.rb b/lib/puppet/network/xmlrpc/client.rb
index 37ace21..33771d5 100644
--- a/lib/puppet/network/xmlrpc/client.rb
+++ b/lib/puppet/network/xmlrpc/client.rb
@@ -39,6 +39,10 @@ module Puppet::Network
Puppet.debug "Calling %s.%s" % [namespace, method]
begin
result = call("%s.%s" % [namespace, method.to_s],*args)
+ if http.started?
+ Puppet.err "HTTP instance still open after call to %s.%s" % [namespace, method]
#!/usr/bin/ruby
require 'puppet'
report = YAML.load_file("/var/puppet/reports/culain.madstop.com/200706241922.yaml")
report.metrics.each do |name, metric|
metric.values.each do |value_name, value_label, value|
puts "%s: %s => %s" % [name, value_label, value]
end
/etc/puppet/modules/tomcat6.
manifests
init.pp
templates
log4j_properties.erb
# log4j_properties.erb contains
log4j.logger.org.apache.commons.httpclient = <%= loglevel_default %>
@lak
lak / gist:64023
Created February 13, 2009 17:30 — forked from anonymous/gist:64014
# /etc/puppet/modules/tomcat/manifests
class tomcat6 {
# define your resource type
define configuration($loglevel_default = 'DEBUG', $loglevel_httpclientapache = 'DEBUG', $loglevel_httpclientwire = 'DEBUG', $loglevel_sportex = 'DEBUG', $loglevel_lus = 'DEBUG', $loglevel_apache = 'DEBUG', $loglevel_springframework = 'DEBUG', $loglevel_quartz = 'DEBUG', $loglevel_apachecxf = 'DEBUG') {
file { "/etc/tomcat6/log4j.properties": content => template("tomcat6/log4j_properties.erb") }
}
/Users/luke/puppet/lib/puppet/util/settings.rb:62:in `optparse_addargs': undefined method `args=' for Puppet:Module (NoMethodError)
from /Users/luke/puppet/lib/puppet/application.rb:251:in `parse_options'
from /Users/luke/puppet/lib/puppet/application.rb:214:in `run'
from bin/puppetmasterd:66
-------------
The fix is:
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
define cronallow($members) {
file { $name: content => template("..."), ensure => present, ... }
}
class base {
cronallow { "/etc/cron.allow": members => root }
}
class sub inherits base {
Cronallow["/etc/cron.allow"] { members +> [postgres, whatever] }
class filesystems {
file { "/etc/exports.d":
ensure => directory,
purge => true,
notify => Exec[rebuild-exports]
}
exec { rebuild-exports:
command => "/bin/cat /etc/exports.d/* > /etc/exports",
refreshonly => true
@lak
lak / git-filebucket
Created March 11, 2009 23:11
A simple script that behaves like a filebucket but with git as a backend
#!/usr/bin/ruby -w
require 'getoptlong'
class FileBucket
def sum
require 'digest/sha1'
raise "Must specify file" unless file = ARGV.shift
class One
attr_reader :two
def two=(two)
@two = two
two.one = self
end
end
class Two
diff --git a/lib/puppet/resource/catalog.rb b/lib/puppet/resource/catalog.rb
index 88aa951..cb0ce03 100644
--- a/lib/puppet/resource/catalog.rb
+++ b/lib/puppet/resource/catalog.rb
@@ -416,6 +416,20 @@ class Puppet::Resource::Catalog < Puppet::SimpleGraph
super
end
+ def to_yaml_properties
+ result = instance_variables