Reputation: 1344
I am trying to do the following with no success
default['foo']['bar'] = ENV['baz']
It is resolving to empty, even though I have set up the environment variable.
Upvotes: 1
Views: 300
Reputation: 10122
ruby native code which is not wrapped with chef resource, such as ruby_block
, will be executed in the compilation phase of chef-client run, and i think this is not your intention.
note that when you use an environment variable, you will need to set it on the converged node.
i would strongly recommend you not to use an environment variable, but to switch to node attribute, which can be set using the --json-attributes
option for chef-client. see this answer for an example.
Upvotes: 1