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:: nagios | |
# Recipe:: server | |
# | |
# Copyright 2009, 37signals | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
package "nagios" 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
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 |
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 :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" |
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[: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] |
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
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_ |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
Chef::Config.from_file("/etc/chef/server.rb") | |
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
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" | |
+ |
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
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 |
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
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' |
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
[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 |