Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Created January 8, 2010 01:01
Show Gist options
  • Save adamhjk/271780 to your computer and use it in GitHub Desktop.
Save adamhjk/271780 to your computer and use it in GitHub Desktop.
[Thu, 07 Jan 2010 19:55:05 -0500] INFO: Starting Chef Solo Run
[Thu, 07 Jan 2010 19:55:06 -0500] WARN: Missing gem 'right_aws'
before migrate
before include
inside poller recipe
/srv/chef/channels-reader-is/chef/chef-repo/site-cookbooks/channels_batchrunner/recipes/poller.rb:34:in `join': can't convert nil into String (TypeError)
from /srv/chef/channels-reader-is/chef/chef-repo/site-cookbooks/channels_batchrunner/recipes/poller.rb:34:in `from_file'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/mixin/recipe_definition_dsl_core.rb:68:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/mixin/recipe_definition_dsl_core.rb:68:in `method_missing'
from /srv/chef/channels-reader-is/chef/chef-repo/site-cookbooks/channels_batchrunner/recipes/poller.rb:30:in `from_file'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/cookbook.rb:166:in `load_recipe'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/recipe.rb:63:in `include_recipe'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/recipe.rb:51:in `each'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/recipe.rb:51:in `include_recipe'
... 12 levels...
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/lib/chef/application.rb:57:in `run'
from /usr/lib/ruby/gems/1.8/gems/chef-0.7.14/bin/chef-solo:26
from /usr/bin/chef-solo:19:in `load'
from /usr/bin/chef-solo:19
deploy "/srv/apps/#{node[:channels][:app_name]}" do
repo "ssh://builder@cvs.tacitknowledge.com/gitroot/channels-reader.git"
enable_submodules true
branch "HEAD"
user "channels"
environment "RAILS_ENV" => "production"
symlinks "config/broker.yml" => "config/broker.yml",
"config/s3-thumbnails.yml" => "config/s3-thumbnails.yml",
"pids" => "tmp/pids",
"sitemaps" => "public/sitemaps",
"sitemaps/sitemap_index.xml" => "public/sitemap_index.xml",
"system" => "public/system",
"log" => "log"
# restart kill mplayers, restart pollers?
# restart_command "touch tmp/restart.txt"
action :deploy
puts "before migrate"
before_migrate do
puts "inside before migrate"
# create the shared directories
%w{config log pids sitemaps system}.each do |dir|
directory "#{new_resource.shared_path}/#{dir}" do
mode "0755"
end
end
# install the production config files
%w{database.yml broker.yml}.each do |filename|
remote_file "#{new_resource.shared_path}/config/#{filename}" do
source "#{filename}"
end
end
end # end before_migrate
node[:channels][:poller_work_dir] = new_resource.current_path
node[:channels][:poller_run_as] = new_resource.user
end
puts "before include"
include_recipe "channels_batchrunner::poller"
puts "inside poller recipe"
service "monit" do
end
template "/etc/init.d/poller" do
source "initd_poller.erb"
variables({:poller_run_as => node[:channels][:poller_run_as], :poller_work_dir => node[:channels][:poller_work_dir]})
mode 0755
owner "root"
end
template "/etc/monit.d/poller.conf" do
source "poller.conf.erb"
mode 0644
owner "root"
variables({:num_pollers => node[:channels][:num_pollers], :pid_dir => File.join(node[:channels][:poller_work_dir], "tmp", "pids")})
end
~ ~ ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment