Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
# sources.list
deb http://za.archive.ubuntu.com/ubuntu/ jaunty main restricted
deb-src http://za.archive.ubuntu.com/ubuntu/ jaunty main restricted
deb http://security.ubuntu.com/ubuntu jaunty-security main restricted
deb-src http://security.ubuntu.com/ubuntu jaunty-security main restricted
deb http://za.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted
deb-src http://za.archive.ubuntu.com/ubuntu/ jaunty-updates main restricted
deb http://za.archive.ubuntu.com/ubuntu/ jaunty universe
# muppet/app/models/log.rb:
class Log < ActiveRecord::Base
belongs_to :report
end
# muppet/app/models/report.rb:
class Report < ActiveRecord::Base
belongs_to :host
# This fix should only be applied to FastCGI-enabled hosts, because our
# FastCGI implementation provides per-user session directories, which
# get around the strict permissions problem that had Debian disable
# session garbage collection in the first place.
class php_session_gc_fix {
file {
"/etc/php4/conf.d/session_gc_fix.ini":
ensure => $fastcgi == ? {
1 => file,
# This fix should only be applied to FastCGI-enabled hosts, because our
# FastCGI implementation provides per-user session directories, which
# get around the strict permissions problem that had Debian disable
# session garbage collection in the first place.
class php_session_gc_fix {
file {
["/etc/php4/conf.d/session_gc_fix.ini", "/etc/php5/conf.d/session_gc_fix.ini"]:
ensure => $fastcgi == ? {
1 => file,
# This fix should only be applied to FastCGI-enabled hosts, because our
# FastCGI implementation provides per-user session directories, which
# get around the strict permissions problem that had Debian disable
# session garbage collection in the first place.
class php_session_gc_fix {
file {
["/etc/php4/conf.d/session_gc_fix.ini", "/etc/php5/conf.d/session_gc_fix.ini"]:
ensure => $fastcgi ? {
1 => file,
[4, 5].each do |version|
fact = "php#{version}_extensions".to_sym
Facter.add(fact) do
setcode do
extensions = []
IO.popen("php#{version} -i").each do |line|
line.chomp!
line.gsub!(/^ionCube Loader$/, "ioncube")
line.gsub!(/^Zend Optimizer$/, "zend_optimizer")
if line =~ /^[a-z0-9_]+$/
def hos_server(host, attr)
value = nil
server_block = nil
File.open("/etc/hos_server").each do |line|
line.chomp!
if line =~ /^server:\s+(\S+)\s+\{\s*$/
if host == $1
server_block = host
else
server_block = nil
node default {
include a_bunch_of_stuff
# ...
case $fqdn {
'wombat3.cpt1.example.com',
'wombat3.cpt2.example.com',
'wombat2.jnb1.example.com',
'wombat2.jnb2.example.com',
'wombat3.nur4.example.com',
# manifests/classes/puppetmaster.rb
class puppetmaster {
$branch = $fqdn ? {
'puppet1.hetzner.africa' => 'trunk',
default => 'branches/production',
}
cron { puppetmaster_clean_reports:
ensure => absent,
user => puppet,