[chef] using attributes to pass information about resources between nodes


Chronological Thread 
  • From: Dmitry V'yal < >
  • To:
  • Subject: [chef] using attributes to pass information about resources between nodes
  • Date: Thu, 29 Jul 2010 14:53:38 +0400
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=jh8kZ+azpiLCtYaAwgL/1tddq4PwsGEEVN2g6ljUhxNCMRUa9ruJ15ii8ffM45vk4D ylwgTzos/Ai/xwhUqNmVofuKIFyvuLdiZF7DvmHVr04VOoIfzZBpBgdHOrKwlAOzeDhw Zgy8BzMTTgmcpPQA6ldB3sRliodo+K6NjnsNA=

Hello Chefs,

several times I encountered the situation, there some of my nodes had a resource defined and other node(s) had to generate some file based on attributes of resources of other nodes. As advised, I made use of node attributes to make the needed data available to other nodes. After it chef's search functionality allows to get the data and build the file.

The trouble arises then the resource is defined on the node which later generates the file. The attribute gets updated _after_ the compile phase when file resource is defined. So in order to converge two chef runs must be made.

This can be solved by defining the resource inside the ruby_block, but it looks awful.

Another problem is that even then using ruby_block chef index gets updated too late, so in addition to iterating the search results I have to manually merge the data from node attribute. Is there a way to update the index in the middle of chef run?

The described scheme works, but it's far from being clear and ideal. There should be a better way. Chefs? :)

Best regards,
Dmitry


  • [chef] using attributes to pass information about resources between nodes, Dmitry V'yal, 07/29/2010

Archive powered by MHonArc 2.6.16.

§