[chef] Re: Re: strange node attribute problem


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: strange node attribute problem
  • Date: Thu, 23 May 2013 08:11:47 -0700


On Thursday, May 23, 2013 at 12:48 AM, Kannan Manickam wrote:

John,

Yes, that is the expected behavior. The block inside the ruby block gets executed during the converge phase where as the attributes for the mount resources gets set during the compile phase. So even though the the mount resource's action gets executed during the converge phase the value of the attributes for that resource will not get updated after the ruby block's execution.

You have three possible solutions here:

1. Change the ruby_block to get executed during compile time if that will work for you.
2. Change the logic of mount to be executed as ruby code inside the ruby_block itself.
3. Few days ago, I was playing with a hack to dynamically setting attributes of resources https://gist.github.com/arangamani/4659646 - It is not a cleaner way but a working solution.

I would be glad to know if there are other solutions.

Cheers,
Kannan.
Chef 11.6 will have a lazy attribute feature that would handle this pretty easily:

http://tickets.opscode.com/browse/CHEF-3731


-- 
Daniel DeLeo
 



Archive powered by MHonArc 2.6.16.

§