[chef] Re: resource in a ruby_block?


Chronological Thread 
  • From: "John E. Vincent (lusis)" < >
  • To:
  • Cc: Jeremy Winters < >
  • Subject: [chef] Re: resource in a ruby_block?
  • Date: Thu, 17 Mar 2011 23:35:38 -0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=qp25zVqRijSOyApmHQO0UseaDsH3mKn34bDE52A3u9r0/OFJqIFZM566XcnjJhconm kJkvl3UaaNfhZ4ynYl+x/oR+rVh/wJPLqp1wNpSF8lK4X37HfskzhkA2VgIOpSFV3ZrM du9iWJu8khAG+0vA2AMSfuA9h1aotHVhR8GtE=

Why the nesting? Can you not make the inner operation idempotent based
on the primary condition? You can pass a block to the idempotence
statements. I do this in my user cookbook:

https://gist.github.com/865645



On Thu, Mar 17, 2011 at 11:31 PM, Jeremy Winters
< >
 wrote:
> I'm looking to do something like this...
>
>
> ruby_block "do something doing convergence" do
>        block do
>                check_value=result_from_database_at_convergence_run_time
>
>                if check_value==0 then
>                        execute "run my sql script" do
>                                cwd "path_to_script"
>                                user "root"
>                                command "./execute_sql_file.rb"
>                        end
>                end
>        end
>        only_if do primary_idempotent_condition==true end
> end
>
> is this possible?  am I missing something?
>
> Jeremy Winters
> 212-202-0449 x1023
> 
>
>
>
>



Archive powered by MHonArc 2.6.16.

§