[chef] Re: rerunnable and idempotent?


Chronological Thread 
  • From: Adam Jacob < >
  • To: " " < >
  • Cc: " " < >
  • Subject: [chef] Re: rerunnable and idempotent?
  • Date: Sat, 3 Apr 2010 09:49:28 -0700

This is a question of what the return code from rabbitmq-server is - in this case, the rabbitmq-server start command returns a non-zero status code, which we (by neccesity) treat as an error.

We can (and will) change the resource so that this is worked around, but the real bug is in the rabbitmq-server init script.

Adam

Sent from my iPhone

On Apr 3, 2010, at 7:38 AM, Mike Bailey < "> > wrote:

Re-running bootstrap::server fails if rabbitmq-server was already started by previous installation.

Should we expect chef recipes to be re-runnable and idempotent? I would suggest a call to start a service should not error out if the service is already running.

thanks,

Mike 

:~# cat solo.rb 
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
:~# cat chef.json 
{
  "bootstrap": {
    "chef": {
      "url_type": "http",
      "init_style": "runit",
      "path": "/srv/chef",
      "serve_path": "/srv/chef",
      "server_fqdn": "chef.failmode.com",
      "webui_enabled": true
    }
  },
  "run_list": [ "recipe[bootstrap::server]" ]

:~# chef-solo -c ~/solo.rb -j ~/chef.json
[Sat, 03 Apr 2010 14:30:50 +0000] INFO: Starting Chef Solo Run
[Sat, 03 Apr 2010 14:31:12 +0000] ERROR: service[rabbitmq-server] (/tmp/chef-solo/cookbooks/rabbitmq_chef/recipes/default.rb line 45) had an error:
/etc/init.d/rabbitmq-server start returned 1, expected 0
/usr/lib/ruby/gems/1.8/gems/chef-0.8.10/bin/../lib/chef/mixin/command.rb:179:in `handle_command_failures'
/usr/lib/ruby/gems/1.8/gems/chef-0.8.10/bin/../lib/chef/mixin/command.rb:122:in `run_command'
/usr/lib/ruby/gems/1.8/gems/chef-0.8.10/bin/../lib/chef/provider/service/init.rb:37:in `start_service'
/usr/lib/ruby/gems/1.8/gems/chef-0.8.10/bin/../lib/chef/provider/service.rb:62:in `action_start'






Archive powered by MHonArc 2.6.16.

§