Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

puppetlabs-rabbitmq: multiple routing keys for same binding

$
0
0
How can I create 2 bindings between the same exchange / queue, but with multiple routing keys? This is legal and works when setup manually. I am using create_resources after pulling the bindings from hiera: create_resources(rabbitmq_binding, $bindings, $binding_defaults) where the source looks like: role::rabbitmq::bindings: [...] 'foo.bar.exchange@foo.bar.xyz.queue@/': routing_key: 'foo.bar.xyz.key' 'foo.bar.exchange@foo.bar.xyz.queue@/ ': routing_key: 'foo.bar.xyz.published.key' There's no error, but since there's a duplicate hash key, only one prevails. Just to make sure it wasn't a problem with my use of create_resources, I also tested rabbitmq_binding { 'foo.bar.exchange@foo.bar.xyz.queue@/': user => $admin_user, password => $admin_pass, destination_type => 'queue', routing_key => 'foo.bar.xyz.key', arguments => {}, ensure => present, } rabbitmq_binding { 'foo.bar.exchange@foo.bar.xyz.queue@/': user => $admin_user, password => $admin_pass, destination_type => 'queue', routing_key => 'foo.bar.xyz.published.key', arguments => {}, ensure => present, } and of course there's a duplicate resource error that way. Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Rabbitmq_binding[foo.bar.exchange@foo.bar.xyz.queue@/] is already declared; cannot redeclare at /etc/puppet/modules/role/manifests/rabbitmq.pp:XXX on node foo.example.net I tried making routing_key an array, as well as a comma-delimited string, and even space-padding the hash key (this latter I think might work if I edit the validation rules in the module), and none of that seems to work. It also doesn't seem that there's a way to set the name separately from the resource name, but let me know if I'm wrong there and there's an undocumented way to do this. Some discussion in https://tickets.puppetlabs.com/browse/MODULES-3679 and a fix in progress at https://github.com/puppetlabs/puppetlabs-rabbitmq/pull/490 I changed it so that it will (in a backwards compatible way) accept an array of routing_key values, however, this approach has some limitations. Would appreciate some more eyes and / or help if anyone else is interested in this. Long term, I think making one resource for each binding is better, but seems like this might have to break backwards compatibility, and would create some big hassles.

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>