config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "/Users/fullofcaffeine/workspace/code/chef-repo/cookbooks"
chef.roles_path = "/Users/fullofcaffeine/workspace/code/chef-repo/roles"
chef.data_bags_path = "/Users/fullofcaffeine/workspace/code/chef-repo/data_bags"
#run list
chef.add_recipe("rails_ghetto::user")
chef.add_recipe("rails_ghetto::deploy")
chef.add_recipe("rails_ghetto::nginx_sites_enable")
#chef.add_recipe("php")
chef.json = { "rails_ghetto" => {
"deployment_user" => "deploy",
"deployment_group" => "deploy",
"apps_root" => "/var/www/apps",
"libs" => ["libxslt-dev","libxml2-dev"],
"applications" => {"sample" => {
"repository" => " :fullofcaffeine/raks.git",
"revision" => "master",
"deploy_key" => "/home/root/.ssh/github",
"unicorn_port" => "8080",
"server_name" => "production.example.com",
"compile_assets" => "true",
"run_migrations" => "true",
"rails_environment" => "production",
"database" => { "adapter" => "postgresql",
"database" => "sample2",
"username" => "root",
"password" => "changeit" },
}
},
"recipes" => ["rails_ghetto::user","rails_ghetto::deploy","rails_ghetto::nginx_sites_enable"]
}
}
end
Generated at Mon Sep 10 06:03:34 +0000 2012
NameError: Cannot find a resource for application on ubuntu version 12.04
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource_platform_map.rb:129:in `get'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource.rb:667:in `resource_for_platform'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/resource.rb:684:in `resource_for_node'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/recipe_definition_dsl_core.rb:58:in `method_missing'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rails_ghetto/recipes/deploy.rb:9:in `from_file'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rails_ghetto/libraries/default.rb:7:in `call'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rails_ghetto/libraries/default.rb:7:in `rails_applications'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/node/attribute.rb:136:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/node/attribute.rb:136:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/node/attribute.rb:129:in `each'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rails_ghetto/libraries/default.rb:4:in `rails_applications'
/tmp/vagrant-chef-1/chef-solo-1/cookbooks/rails_ghetto/recipes/deploy.rb:8:in `from_file'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/cookbook_version.rb:578:in `load_recipe'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:46:in `load_recipe'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:33:in `include_recipe'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:72:in `load'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/run_context.rb:69:in `load'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:199:in `setup_run_context'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/client.rb:162:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:207:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `loop'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application/solo.rb:195:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/../lib/chef/application.rb:70:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-0.10.10/bin/chef-solo:25
/opt/vagrant_ruby/bin/chef-solo:19:in `load'
/opt/vagrant_ruby/bin/chef-solo:19
Wow! Thanks for the comprehensive reply Andrea!I'll try those suggestion tonight. @Igor, I'll check out rails_ghetto as well! I'll share my experience here afterwards.Meanwhile, I have a quick question regarding the approach of Bryan Baugher, in this thread:How would that work?Thank you *very much* again for the replies!- Marcelo.
On Thu, Aug 16, 2012 at 5:22 AM, Igor Afonov < " target="_blank"> > wrote:
Andrea,Wow, thanks, I've totally missed that I can do it like that. I thought that there maybe a better way to do it but totally missed most obvious way.четверг, 16 августа 2012 г. в 11:38, Andrea Campi написал:
Igor,On Thu, Aug 16, 2012 at 9:36 AM, Igor Afonov < " target="_blank"> > wrote:Hi Marcelo,I've already mentioned in this list but I have a cookbook which is basicallywhat you need. It manages deployment of several very similar railsapplications. As Andrea mentioned if you have different applications it isbetter to have a separate cookbooks for them. But for your case here is thecookbook - https://github.com/iafonov/rails_ghetto. I'm 100% sure that you'dhave to change it for your needs. I'm not a big fan of data bags (thiscookbook was initially created for chef-solo) but if you are - you can quiteeasily alter it to use data bags instead of attributes.I had a look at rails_ghetto some time ago and I like it. If anything,it shows a big benefit of the "new" application cookbook: you wereable to reuse its LWRPs to add functionality on top.One question though: how come you rolled your own nginx_sites_enableinstead of using application_nginx? Any missing functionality there?At a cursory glance it looks like a perfect match, you just need tospecify your own template.I.e. in your recipes/deploy.rb:rails_applications do |name, app|application name do…nginx dotemplate "nginx_site.erb"cookbook_name "rails_ghetto"endendendAnd you'd be pretty much set.Did you try that and hit any roadblock?Andrea
Archive powered by MHonArc 2.6.16.