This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merb.logger.info("Compiling routes...") | |
Merb::Router.prepare do |r| | |
# This deferred route allows permalinks to be handled, without a separate rack handler | |
match("/:permalink").defer_to do |request, params| | |
unless (article = Article.find_by_permalink(params[:permalink)).nil? | |
{:controller => "articles", :action => "show", :id => article.id} | |
end | |
end | |
# Admin namespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define monit_file($ensure = 'absent') { | |
include monit | |
case $ensure { | |
'present': { | |
file { | |
"/etc/monit.d/${name}.run": | |
owner => "root", group => "root", mode => "0644", | |
replace => true, | |
source => "puppet:///monit/${name}.run", | |
notify => Service["monit"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service "apache2" do | |
name value_for_platform( | |
[ "CentOS", "RedHat", "Fedora", "SuSE" ] => { "default" => "httpd" }, | |
"Ubuntu" => { "8.04.1" => "apache2_lolz", "default" => "apache2" }, | |
"Debian" => { "default" => "apache2" } | |
) | |
supports :restart => true | |
action :enable | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node[:xen_vms].each do |name,vm| | |
execute "create-vm" do | |
command "xen-create-image --hostname #{name} --ip #{vm[:ip]} --size #{vm[:disk]} --memory #{vm[:memory]}" | |
creates "/etc/xen/#{name}.cfg" | |
notifies :run, resources("execute[start-vm") | |
end | |
execute "start-vm" do | |
command => "xm create #{name}.cfg" | |
unless "xm list | grep #{name}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define :add_htpasswd_users do | |
params[:users].each do |auth| | |
execute "add_htpasswd_#{auth[:username]}" do | |
command "echo '#{auth[:username]}:#{auth[:password]}' >> #{params[:name]}" | |
not_if do | |
if File.exists?(params[:name]) | |
File.open(params[:name]) do |password_file| | |
password_file.detect { |line| line =~ /#{auth[:username]}:#{auth[:password]}/ } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources in cookbook: | |
user "dnscache" do | |
uid 9997 | |
case node[:platform] | |
when "ubuntu","debian" | |
gid "nogroup" | |
when "redhat", "centos" | |
gid "nobody" | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: apt | |
# Recipe:: default | |
# | |
# Copyright 2008, OpsCode, Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--git a/chef-server-slice/Rakefile b/chef-server-slice/Rakefile | |
index 8cb5b22..64d958e 100644 | |
--- a/chef-server-slice/Rakefile | |
+++ b/chef-server-slice/Rakefile | |
@@ -47,7 +47,7 @@ Rake::GemPackageTask.new(spec) do |pkg| | |
end | |
desc "Install the gem" | |
-task :install do | |
+task :install => :package do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Divine Panda | |
service "foo" do | |
action :nothing | |
end | |
template "/etc/foo/config.conf" do | |
source "config.conf.erb" | |
action :create | |
notifies :restart, resources(:service => "foo") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DEBUG: Processing user[lachie] | |
DEBUG: user[lachie] using Chef::Provider::User::Useradd | |
DEBUG: Setting user[lachie] comment to Lachie Cox | |
DEBUG: Managing the home directory for user[lachie] | |
DEBUG: Executing usermod -c 'Lachie Cox' -m lachie | |
DEBUG: Nothing to read on 'usermod -c 'Lachie Cox' -m lachie' STDOUT. | |
DEBUG: ---- Begin usermod -c 'Lachie Cox' -m lachie STDERR ---- | |
DEBUG: Usage: usermod [options] LOGIN | |
Options: |
OlderNewer