[chef] Re: Re: Re: Re: Re: Re: Understanding node attributes set from 'role' cookbooks


Chronological Thread 
  • From: Torben Knerr < >
  • To: " " < >
  • Subject: [chef] Re: Re: Re: Re: Re: Re: Understanding node attributes set from 'role' cookbooks
  • Date: Tue, 18 Mar 2014 07:43:41 +0100


The key here for me was that cookbook attributes files are all
evaluated in their entirety before recipes are evaluated, hence any
login in attributes files cannot be manipulated from recipes.

FYI: you can still reload the attributes file from within a recipe, see here:

For example:
```
# override some node attributes here
node.set ....

# re-evaluate attributes files whose attributes are computed based on the ones above
node.from_file(run_context.resolve_attribute("postfix", "default"))

# include actual recipes which need the attributes
include_recipe 'postfix::default'
include_recipe 'postfix::sasl_auth'
```

Maybe this works in your situation as well?

HTH, Torben


 

Many thanks for the help guys.

Lewis




Archive powered by MHonArc 2.6.16.

§