Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overriding Chef run list but keep using node attributes

Tags:

chef-infra

Is there a way to use chef-client's -o command to override the run list but also still keep using the existing node attributes?

As mentioned here when you override the run list with chef-client -o ... then the node attributes are consequently no longer applied.

like image 743
Friedrich 'Fred' Clausen Avatar asked May 10 '26 03:05

Friedrich 'Fred' Clausen


1 Answers

I don't think that comment is entirely correct. Override run lists should have no effect on attributes set on the node directly, and attributes from things on the run list happen as per normal. If you are asking if there is a way to load attributes from all your primary run list entries and their dependencies, but only run a specific subset of the recipes, I'm not aware of a general solution for that. For a specific case you could make a dummy cookbook that depends on all the things in the primary run list with a single blank recipe, and include that as the first item of the override run list. You can't do that dynamically though, so you would need one such dummy cookbook for each situation where this comes up.

like image 97
coderanger Avatar answered May 12 '26 21:05

coderanger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!