Node attributes don't get overridden until chef-client runs twice


#1

Hi there

We are overriding some node attributes in our recipes. When the runlist completes for the node and I check the node attributes, I still see the old values. Now when I run the chef-client again on the same node and once it completes its run, I can see the updated node attribute value.

I’m overrding the node attribute like this:

node.override['foo']['bar']['ready'] = false

Can someone please tell me what I’m doing wrong and why do I need to run the chef-client twice?

Thanks!


#2

We would need a little more information here. Where in your cookbook are you setting the override? I am just wondering if you are running into a condition where the specific code is not running unless a certain condition exists, hence why you have to run it twice.