Skip to content

Instantly share code, notes, and snippets.

View jsierles's full-sized avatar
🎯
Focusing

Joshua Sierles jsierles

🎯
Focusing
View GitHub Profile
#
# Cookbook Name:: nagios
# Recipe:: server
#
# Copyright 2009, 37signals
#
# All rights reserved - Do Not Redistribute
#
package "nagios" do
package "nagios" do
package_name 'nagios3'
action :install
end
hosts = []
search(:node, "*") {|node| hosts << node }
service "nagios3" do
supports :status => true, :restart => true, :reload => true
define :nagios_conf, :variables => {}, :config_subdir => true do
subdir = if params[:config_subdir]
"/#{node[:nagios][:config_subdir]}/"
else
"/"
end
template "#{node[:nagios][:root]}#{subdir}#{params[:name]}.cfg" do
owner "nagios"
node[:groups].each do |g|
group g[:name] do
gid g[:gid]
end
end
node[:users].each do |u|
user u[:name] do
comment u[:comment]
uid u[:uid]
ERROR: remote_file[/usr/local/src/ruby-enterprise-1.8.6-20090201.tar.gz] (/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/recipe.rb line 186) had an error:
closed stream
/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:49:in `close'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:49:in `only_if'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:296:in `[]'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:296:in `popen4'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/mixin/command.rb:49:in `only_if'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/runner.rb:69:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/resource_collection.rb:58:in `each'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/resource_collection.rb:57:in `each'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/runner.rb:63:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/client.rb:343:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.5.3/lib/chef/client.rb:96:in `run_
#!/usr/bin/ruby
require 'rubygems'
require 'thor'
require 'chef'
require 'chef/node'
require 'chef/rest'
Chef::Config.from_file("/etc/chef/server.rb")
diff --git a/chef/recipes/server.rb b/chef/recipes/server.rb
index b07f20c..c715439 100644
--- a/chef/recipes/server.rb
+++ b/chef/recipes/server.rb
@@ -17,6 +17,30 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+include_recipe "runit"
+
user u do
comment config[:comment]
uid config[:uid]
gid config[:group].to_s
home "/home/#{u}"
shell "/bin/bash"
password config[:password]
supports :manage_home => true
0 /usr/local/lib/site_ruby/1.8/rubygems.rb 723 in `initialize'
1 /usr/local/lib/site_ruby/1.8/rubygems.rb 723 in `new'
2 /usr/local/lib/site_ruby/1.8/rubygems.rb 723 in `set_paths'
3 /usr/local/lib/site_ruby/1.8/rubygems.rb 719 in `each'
4 /usr/local/lib/site_ruby/1.8/rubygems.rb 719 in `set_paths'
5 /usr/local/lib/site_ruby/1.8/rubygems.rb 526 in `path'
6 ./init.rb 60
7 /usr/lib/ruby/gems/1.8/gems/merb-core-1.0.8.1/lib/merb-core/bootloader.rb 520 in `load'
8 /usr/lib/ruby/gems/1.8/gems/merb-core-1.0.8.1/lib/merb-core/bootloader.rb 520 in `load_initfile'
9 /usr/lib/ruby/gems/1.8/gems/merb-core-1.0.8.1/lib/merb-core/bootloader.rb 388 in `run'
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin os
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin ruby
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin languages
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin kernel
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin ohai_time
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin erlang
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin hostname
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin linux::hostname
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin network
[Fri, 13 Feb 2009 11:14:39 -0600] INFO: Loading plugin linux::network