-
Notifications
You must be signed in to change notification settings - Fork 28
Chef inadvertently manages shared config instead of default #20
Comments
@swalberg sorry for the slow reply. The “Running Exhibitor” docs make this very confusing, but I’ll try to sort it out in the context of this cookbook. To explain a bit:
Perhaps what you’re really pointing out is that the content of that file should not be Chef-managed? And instead, the defaults should be set, then this file left alone for Exhibitor to handle? I.e., lines 75-80 of |
Hi Jeff, yes, I think we're talking about the same thing, just approaching from different sides. If Chef manages that shared state file then it's always going to reset it to having a single node. Since exhibitor watches for changes to that file, the update will break the cluster. Removing those lines will probably fix the problem but won't create the default file. The problem, as I see it, is that the code is overloading the meaning of the same attribute but forgetting that other things in the Chef attribute priority scheme may come together to override the intent. Or, put another way, the code switches between managing the default file and shared state file by setting a |
@swalberg yeah, I think we’re pretty close to understanding each other. The default config file is always created, at the end of the recipe, and Exhibitor uses that as a kind of “bootstrap” for its own shared config if it doesn’t exist. If that shared config does exist, it uses that to override what’s in the default config, which includes things like the other Exhibitor/ZK nodes in your cluster. As for the attributes, I think it’s just that the Perhaps best would be to just ensure that the shared config exists, and is owned by Exhibitor, and otherwise leave it be? E.g., file ::File.join(node[:exhibitor][:cli][:fsconfigdir], node[:exhibitor][:cli][:fsconfigname]) do
owner node[:exhibitor][:user]
mode 00600
end |
Perhaps f3c489a does the trick? If not, I’ll revert it. |
Yes, that should do it. Thanks! |
@swalberg sorry this took so long; shipped 0.6.0 to Supermarket just now! |
Running in file mode with my options specified in the node at normal level:
Chef keeps managing the shared config file:
Comments at https://github.com/SimpleFinance/chef-exhibitor/blob/master/attributes/default.rb#L34 mention the hash should be managing the default config, but the recipe manages the shared config in https://github.com/SimpleFinance/chef-exhibitor/blob/master/recipes/default.rb#L71-L74:
I'm not sure of the purpose of the first 2 lines because they won't get used since I'm applying my config at the normal level. However I think the file resource should be
node[:exhibitor][:cli][:defaultconfig]
instead of what's there.The text was updated successfully, but these errors were encountered: