"default_attributes": {"my_attr": "/my/path"},
default['my_cookbook']['cookbook_dir'] = "#{node[: my_attr]}/some/directory"
Chef::Log.info(node[:my_attr])Chef::Log.info(node['my_cookbook']['cookbook_dir'])
INFO: /my/pathINFO: /some/directory
INFO: /my/pathINFO: /my/path/some/directory
Ok, what he said. :)
On Wed, Dec 26, 2012 at 11:07 AM, Daniel DeLeo < " target="_blank"> > wrote:
>
> On Wednesday, December 26, 2012 at 8:00 AM, Mike wrote:
>
> Hi Steven,
>
> You've placed your debugging code in the attributes/default.rb file,
> this gets evaluated at compile time.
>
> Have you tried placing the same debugging code in the
> recipes/default.rb (or somewhere like that) where the debugging
> statement will show what the value of an attribute is at the execution
> phase?
>
> -Mike
>
> A slightly longer explanation:
>
> Attributes from roles and environments are not applied to the node until
> after attributes files have all been evaluated. In Chef 11, this has been
> changed and you will be able to use role/environment attributes in
> attributes files.
>
>
> --
> Daniel DeLeo
>
Archive powered by MHonArc 2.6.16.