[chef] rerunnable and idempotent?


Chronological Thread 
  • From: Mike Bailey < >
  • To:
  • Subject: [chef] rerunnable and idempotent?
  • Date: Sun, 4 Apr 2010 01:38:22 +1100
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=N3vd1UVf8FYA0YKdMDQhMwpNFj5C9VUrW6T/IOG5Ig9zn5GlqT9xesQZIWHeboIABf rEKbKMWC+ipc+myf4AmoiD1KzW79vf4oxSOm4SexVCgFFWYNuZX5nIX0QmzKlIj9QeQg Lyy61ZfNrlF9hryw854ZoPnJpQGZldlBS5JLQ=

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.

§