Skip to content

Instantly share code, notes, and snippets.

View masterzen's full-sized avatar

Brice Figureau masterzen

View GitHub Profile
diff --git a/lib/puppet/util/monkey_patches.rb b/lib/puppet/util/monkey_patches.rb
index 7ce1ccc..a9db622 100644
--- a/lib/puppet/util/monkey_patches.rb
+++ b/lib/puppet/util/monkey_patches.rb
@@ -1,4 +1,4 @@
-Process.maxgroups = 1024
+#Process.maxgroups = 1024
module RDoc
def self.caller(skip=nil)
in_gem_wrapper = false
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
$:.unshift('/home/brice/devl/puppet/lib')
$0 = "puppetmasterd"
require 'puppet'
ARGV << "--verbose"
ARGV << "--trace"
ARGV << "--confdir"
ARGV << "/tmp/master"
ARGV << "--vardir"
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;
GET /production/catalog/node.daysofwonder.com?facts=<encodedfacts>&facts_format=b64_zlib_yaml HTTP/1.1
# 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 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
class bacula::fd {
$password = generate("bacula-pass");
# client fd config
file {
"/etc/bacula/bacula-fd.conf":
content => template("bacula/fd.conf")
}
# bacula dir config
@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'
@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