[chef] RE: [Potential SPAM] Re: Help with window_batch conditional?


Chronological Thread 
  • From: "Fouts, Chris" < >
  • To: " " < >
  • Subject: [chef] RE: [Potential SPAM] Re: Help with window_batch conditional?
  • Date: Tue, 3 Feb 2015 23:38:39 +0000
  • Accept-language: en-US

Duh on me, that makes sense.

 

The logging code was just test code. I want to do something real between the do-ends, but only do it once. I want to use chef resources so I’m shying away from ruby_block for this one.

 

Chris

 

From: Daniel Condomitti [mailto:
Sent: Tuesday, February 03, 2015 6:14 PM
To:
Subject: [Potential SPAM] [chef] Re: Help with window_batch conditional?

 

The block (code between do/end) is still evaluated, otherwise not_if/only_if wouldn’t fire. cwd/cmd are conditional on the only_if/not_if directives.

 

If you need to run ruby code conditionally (such as logging) use a ruby_block and notifies.

 

On Tuesday, February 3, 2015 at 2:59 PM, Fouts, Chris wrote:

I’m testing logic where I only do one of the windows_batch resource below, but for some reason, I see both logs. Note: I will eventually replace the {true} with a node attribute that I set.

 

What am I missing?

 

windows_batch "FlexnetDB Full Installation" do

  only_if {true}

  Chef::Log.info("

***************************************************

FlexnetDB Full Installation

***************************************************

")

end

 

windows_batch "FlexnetDB Upgrade Installation" do

  not_if {true}

  Chef::Log.info("      

***************************************************

FlexnetDB Upgrade Installation

***************************************************

")

end

 

 




Archive powered by MHonArc 2.6.16.

§