rabbitmq / chef-cookbook

Development repository for Chef cookbook RabbitMQ
https://supermarket.chef.io/cookbooks/rabbitmq
Apache License 2.0
213 stars 425 forks source link

Support for arbitrary config sections #442

Open acranox opened 7 years ago

acranox commented 7 years ago

prior to 4.11.0 i was able to add a an item to node['rabbitmq']['conf'], for setting custom rabbitmq_management config options, but with this change: https://github.com/rabbitmq/chef-cookbook/blob/master/templates/default/rabbitmq.config.erb#L21-L26 any arbitrary configs won't be honored, because you end up with two rabbitmq_management [] blocks, which don't seem to get merged, so it doesn't work.

A more flexible way to define the configuration options would be awesome.

michaelklishin commented 7 years ago

@acranox feel free to submit a PR that adds support for more options

acranox commented 7 years ago

Fair enough.

I'm really suggesting a complete rewrite for arbitrary and flexible configuration implementation. ie: the difference between these two templates: https://github.com/openstack/cookbook-openstack-compute/blob/liberty-eol/templates/default/nova.conf.erb https://github.com/openstack/cookbook-openstack-compute/blob/stable/mitaka/templates/default/nova.conf.erb

The way the template is today doesn't allow setting any options for the rabbitmq_management plugin.

michaelklishin commented 7 years ago

@acranox there was a fair number of breaking changes in this cookbook recently. I'm not a fan of "let's rewrite everything" but adding more properties is a backwards-compatible and easy way out. Except for perhaps TLS listener options and sample retention policies, all other properties are trivial to cover that way.

michaelklishin commented 7 years ago

That said, free form (text) sections are not mutually exclusive with what I'm suggesting above and I am not against that approach in general.

dragonsmith commented 6 years ago

Hello @michaelklishin @acranox

Please, let me revive this thread a bit. I've started to use this cookbook recently. And I stumbled on a similar problem as @acranox . If I understand the previous messages right, small non-breaking changes to improve the situation are welcome. So I've created the pull request to enable ip address selection for management console: #464

Please, can you review it and tell me your thoughts? It would be great if we can fix at least this part.

Thank you very much!

michaelklishin commented 6 years ago

I suggest that we wait for RabbitMQ 3.7 and switch to the new config format instead. It is significantly easier to generate and adding arbitrary config lines will also be possible, which should side step most of such issues entirely.

@acranox @dragonsmith how does that sound?

dragonsmith commented 6 years ago

@michaelklishin

That sounds reasonable. If I'll have/see an opportunity to help you I'll come back to open a new discussion. Thank you very much!!!

majormoses commented 6 years ago

I'm excited to use the new config format! Even discounting custom config which I ended up eventually just specifying my own template, writing serverspec tests to validate config with the old format was less than pleasant with long ugly regexes.

michaelklishin commented 6 years ago

So there already are arbitrary config sections but I can imagine they are not very easy to use, so this can be closed when we make it trivial to hook up a bunch of arbitrary lines from the new format in 6.0.