-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
Since the "settings" library method is used, these attributes should not be defined in attribute files.
Since node object is read-only, 'settings' should be a hash.
@bflad, Please, check this out. |
If collision occurs, then values from data bag have a higher priority than attribute values.
I've just improved the definition of Stash settings in |
I've fixed some issues by applying the deep merge to hashes. Now it is working fine, look at the example below.
At the same time there is a
In the result values from attributes will be overridden by settings from the data bag:
|
@legal90 this is an excellent improvement - thanks! Sorry it took me so long to get this in here. I double checked the README documentation and it already mentions the override behavior which this actually makes work as expected. |
Will release in 3.13.0 |
1. Default settings should not be specified in attribute files
Chef::Recipe::Stash.settings
method is going to set default settings:But it will never be done because the node will always have these attributes specified in
attributes/default.rb
.For example, even if we set
['database']['type'] = 'postgresql'
, the port will be "3306" anyway. So that, these attributes should not be specified in attribute file.2.
default_database_port
method is unavailableThis method should be a class method, instead of an instance method. Otherwise, it can not be called from
Chef::Recipe::Stash.settings
method3.
settings
should be a hash.While copying
settings ||= node['stash']
it should be also converted to Hash object, becouse Node object is read-only and overriding below will be unavailable.