[chef] Re: Dynamically building attributes (ie. via search) for cross-service, cross-node configuration


Chronological Thread 
  • From: Joshua Timberman < >
  • To:
  • Subject: [chef] Re: Dynamically building attributes (ie. via search) for cross-service, cross-node configuration
  • Date: Tue, 28 Dec 2010 11:52:10 -0700

Hello!

On Tue, Dec 28, 2010 at 9:25 AM, Charles Duffy 
< >
 wrote:
> How can I build up a description of my firewall rules using knowledge of the
> other nodes' configuration, and ensure that this information is available
> when the templates are applied?

We recommend using the attributes files in the cookbook simply for
setting default values.

default[:shorewall][:rules] = []

So they don't cause nil errors when accessed elsewhere.

Then you can use the recipe to do a search, generate the rules as
hashes (per your code example, but assign to generated_rules), then
something like:

node.set[:shorewall][:rules] = generated_rules

Near the end.

-- 
Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman



Archive powered by MHonArc 2.6.16.

§