[chef] Re: Re: https://github.com/opscode-cookbooks/application


Chronological Thread 
  • From: Andrea Campi < >
  • To: " " < >
  • Subject: [chef] Re: Re: https://github.com/opscode-cookbooks/application
  • Date: Sun, 11 Nov 2012 10:33:27 +0100

There are a couple of known issue with Chef >= 10.14; you are using 10.14.2 which is worse than 10.14.4.

There is a pull request to fix those problems, you can try getting the cookbook from my branch: https://github.com/andreacampi/application/tree/COOK-1673
That should fix it; if it doesn't, I'd like to hear it.


On Sun, Nov 11, 2012 at 5:08 AM, Nilesh < " target="_blank"> > wrote:
Thanks for the gist. 

I used it my my sample rails app. It seems to checkout from github correctly using key I provided, succeeded in copying to /var/www/ and then attempts a bundle install and fails :( 

[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] copied the cached checkout to /var/www/releases/56176387b70062bf1990c53d08b8eae65f5b9d49
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set user to vagrant
[2012-11-11T03:51:47+00:00] INFO: deploy_revision[myapp] set group to vagrant
[2012-11-11T03:51:47+00:00] INFO: Processing application_ruby_rails[myapp] action before_migrate (myapp::default line 110)
[2012-11-11T03:51:47+00:00] INFO: Running bundle install

================================================================================
Error executing action `before_migrate` on resource 'application_ruby_rails[myapp]'
================================================================================

ArgumentError
-------------
wrong number of arguments (1 for 2)

chef-stacktrace.out follows:
Generated at Sun Nov 11 03:51:47 +0000 2012
ArgumentError: deploy_revision[myapp] (/vagrant/cookbooks/application/providers/default.rb line 122) had an error: ArgumentError: application_ruby_rails[myapp] (myapp::default line 110) had an error: ArgumentError: wrong number of arguments (1 for 2)
/vagrant/cookbooks/application/libraries/default.rb:138:in `provider_for_resource'
/vagrant/cookbooks/application/libraries/default.rb:138:in `deploy_provider'
/vagrant/cookbooks/application/libraries/default.rb:145:in `release_path'
/vagrant/cookbooks/application/resources/default.rb:89:in `release_path'
/vagrant/cookbooks/application/libraries/default.rb:70:in `send'
/vagrant/cookbooks/application/libraries/default.rb:70:in `method_missing'
/vagrant/cookbooks/application_ruby/providers/rails.rb:63:in `class_from_file'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:in `instance_eval'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:207:in `action_before_migrate'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:in `send'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:123:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:in `run_action'
/vagrant/cookbooks/application/providers/default.rb:179:in `run_actions_with_context'
/vagrant/cookbooks/application/providers/default.rb:176:in `each'
/vagrant/cookbooks/application/providers/default.rb:176:in `run_actions_with_context'
/vagrant/cookbooks/application/providers/default.rb:161:in `send'
/vagrant/cookbooks/application/providers/default.rb:161:in `run_deploy'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:in `instance_eval'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:174:in `recipe_eval'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:63:in `converge!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/mixin/why_run.rb:61:in `converge!'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:136:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/provider.rb:125:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource.rb:593:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:49:in `run_action'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `each'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:81:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:94:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in `call_iterator_block'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in `step'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in `iterate'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in `each_with_index'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/resource_collection.rb:92:in `execute_each_resource'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/runner.rb:80:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:378:in `converge'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:420:in `do_run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/client.rb:176:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:230:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `loop'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application/solo.rb:218:in `run_application'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/../lib/chef/application.rb:70:in `run'
/opt/vagrant_ruby/lib/ruby/gems/1.8/gems/chef-10.14.2/bin/chef-solo:25
/opt/vagrant_ruby/bin/chef-solo:19:in `load'
/opt/vagrant_ruby/bin/chef-solo:19




Sure! https://gist.github.com/d0dbbab5af4e3a7c9c43

I did have a bit of trouble with paths in the runit template using Omnibus, but I also had trouble with postgres and Omnibus, so I decided to use system ruby 1.9.3 and skip Omnibus for this project. If you don't need pg/postgres, and you want to use Omnibus, make sure you get the patch to application_ruby to add bundler_command [1]. 

User and group are both required [2], which should be cleaned up a bit. This should be specified in the docs, or there should be logic to deal with both cases. 

Your deploy key and database password should probably go in an encrypted databag [3], but if you're just testing, you can make these strings. 

James


On Sat, Nov 10, 2012 at 3:43 PM, Nilesh < " target="_blank"> > wrote:
Would you feel comfortable sharing a public facing version of that 40 line recipe?
I recently built an ecommerce site for a clothing company [1] I founded with my twin: rails, the application / application_ruby cookbooks, and a 40 line recipe.. configuration management never ceases to amaze me [2].

The cookbooks are a bit rough around the edges, and could use some more documentation, but work great. It will also be less confusing when the old versions are fully deprecated. Let the list know if you have trouble. 

James

[1] www.fromholden.com & http://www.kickstarter.com/projects/wsul/from-holden-perfect-mens-shirts-at-perfect-prices

[2] Chef also recently drove a 4 hour, 1000+ server migration away from a flooded data center to a cloud provider at my day job

On Sat, Nov 10, 2012 at 1:36 PM, Andrea Campi < " target="_blank"> > wrote:
To run rails apps with it, look at its sibling too: https://github.com/opscode-cookbooks/application_ruby

Have a look at its README, create your recipe similar to the examples in the application_ruby README, and you should be 90% of the way, unless you have some special needs.







Archive powered by MHonArc 2.6.16.

§