Skip to content

Instantly share code, notes, and snippets.

View masterzen's full-sized avatar

Brice Figureau masterzen

View GitHub Profile
D, [2010-11-28T16:21:29.314294 #6349] DEBUG -- : 6349 facter.rb:38:in `get_facts': Resetting facter cache after 300 seconds
will raise #<Class:0x7f48d494e048>
E, [2010-11-28T16:21:32.319379 #6349] ERROR -- : 6349 facter.rb:42:in `get_facts': Failed to load facts: #<#<Class:0x7f48d494e048>: execution expired>
E, [2010-11-28T16:21:32.319658 #6349] ERROR -- : 6349 facter.rb:43:in `get_facts': /usr/lib/ruby/1.8/timeout.rb:65:in `exec'
/usr/lib/ruby/vendor_ruby/facter/util/uptime.rb:5:in `get_uptime_simple'
/usr/lib/ruby/vendor_ruby/facter/uptime.rb:6
/usr/lib/ruby/vendor_ruby/facter/util/resolution.rb:117:in `call'
/usr/lib/ruby/vendor_ruby/facter/util/resolution.rb:117:in `value'
/usr/lib/ruby/vendor_ruby/facter/util/fact.rb:75:in `value'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `inject'
@masterzen
masterzen / connect.sh
Created November 15, 2010 07:12
Puppet SSL examples
# this simulates how a puppet agent will connect
openssl s_client -host puppet -port 8140 -cert /path/to/ssl/certs/node.domain.com.pem -key /path/to/ssl/private_keys/node.domain.com.pem -CAfile /path/to/ssl/certs/ca.pem
# outputs:
CONNECTED(00000004)
depth=1 /CN=Puppet CA: master.domain.com
verify return:1
depth=0 /CN=macbook.local
verify return:1
@masterzen
masterzen / GenerateCertificates.sh
Created October 18, 2010 21:08
Puppet-load usage
$ puppet ca --generate puppet-load.domain.com
notice: puppet-load.domain.com has a waiting certificate requestnotice: Signed certificate request for puppet-load.domain.com
notice: Removing file Puppet::SSL::CertificateRequest puppet-load.domain.com at '/var/lib/puppet/ssl/ca/requests/puppet-load.domain.com.pem'
notice: Removing file Puppet::SSL::CertificateRequest puppet-load.domain.com at '/var/lib/puppet/ssl/certificate_requests/puppet-load.domain.com.pem'
class bacula::fd {
$password = generate("bacula-pass");
# client fd config
file {
"/etc/bacula/bacula-fd.conf":
content => template("bacula/fd.conf")
}
# bacula dir config
-- Get the list of French posts translations
SELECT group_concat(p.id)
FROM wp_posts p
INNER JOIN wp_icl_translations tr ON tr.element_id=p.id
WHERE tr.element_type='post_post'
AND tr.language_code='fr'
GROUP BY element_type;
-- this produces this kind of output:
-- 9,13,14,22,24,34,35,42,47,52
# define a proxy cache called 'puppetcache'
# with an in-memory zone of 10MiB (increase this number if you want to be able to cache
# more keys)
# the cache disk path should be on the same filesystem as the proxy_temp_path
proxy_cache_path /var/cache/nginx/cache levels=1:2 keys_zone=puppetcache:10m;
server {
... normal nginx for puppet config...
GET /production/catalog/node.daysofwonder.com?facts=<encodedfacts>&facts_format=b64_zlib_yaml HTTP/1.1
server {
listen 8140;
ssl on;
ssl_session_timeout 5m;
ssl_certificate /var/lib/puppet/ssl/certs/master.pem;
ssl_certificate_key /var/lib/puppet/ssl/private_keys/master.pem;
ssl_client_certificate /var/lib/puppet/ssl/ca/ca_crt.pem;
ssl_crl /var/lib/puppet/ssl/ca/ca_crl.pem;
ssl_verify_client optional;
$:.unshift('/home/brice/devl/puppet/lib')
$0 = "puppetmasterd"
require 'puppet'
ARGV << "--verbose"
ARGV << "--trace"
ARGV << "--confdir"
ARGV << "/tmp/master"
ARGV << "--vardir"
diff --git a/lib/puppet/network/http/rack/rest.rb b/lib/puppet/network/http/rack/rest.rb
index 1047512..a2e60ee 100644
--- a/lib/puppet/network/http/rack/rest.rb
+++ b/lib/puppet/network/http/rack/rest.rb
@@ -46,7 +46,7 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
# what path was requested? (this is, without any query parameters)
def path(request)
- request.path
+ request.path_info