So here is my question - providing some context. We have a use case where we have an attribute - holding an array of values defined in Cookbook - attributes/default.rb file. The attribute is overridden in Chef environment file - this was done under override_attributes, this was moved to default_attributes. The move was done because we want to be able to override the value in KITCHEN_YAML.
We use kitchen-oci Ruby GEM to provision the Kitcehn VM. Overrides from the Chef environment (including from the attribute in question) are used in the Chef recipes.
In KITCHEN_YAML file, the override for the attribute is defined under attributes section.
Now, when converging the Kitchen VM, the following is observed.
- If the Chef environment values are defined under
default_attributesthen the actual value becomes additive. That is, the attribute has a value that is combination of array items defined in Cookbookattributes/default.rbfile andKITCHEN_YAMLfile. - If the Chef environment values are defined under
override_attributesthen the values inKITCHEN_YAMLhave no effect.
Is above (from first point) expected? What would be the ideal way to enable overriding the values in KITCHEN_YAML without having to make a copy of the Chef environment and then making adjustment in that.