Skip to content

Conversation

thomasgoirand
Copy link

The rabbitmq_user provider seemed broken to me, at least with a recent version of rabbitmq (I'm talking about 4.0.5 in Debian 13 aka Trixie).

This small patch fixes the provider.

The rabbitmq_user provider seemed broken to me, at least with a recent
version of rabbitmq (I'm talking about 4.0.5 in Debian 13 aka Trixie).

This small patch fixes the provider.
@wyardley
Copy link
Contributor

wyardley commented Aug 5, 2025

https://github.com/voxpupuli/puppet-rabbitmq?tab=readme-ov-file#module-description

The module has been tested against 3.6, and has some minor fixes for later versions IIRC. I doubt it's been tested with 4.x, and does not currently have any active maintainers.

I would personally like to see something like #926, combined with dropping support for older versions, and making sure we're acceptance testing with a recent RMQ version, before we get too deep into supporting 4.x at all. (Once older version support is dropped, most of the providers could also use the json flag for the CLI, which would resolve a lot of the parsing issues that exist now).

We can happily look at small fixes that improve compatibility with newer versions of RMQ, but for sure we'd need additional spec tests added for how the new output looks. It might also make some more sense to key on the version, for example, like this:

if Puppet::Util::Package.versioncmp(rabbitmq_version, '3.7') >= 0

or like this:
# To maintain compatibility with older versions of RabbitMQ,
# we only deal with vhost metadata >= version 3.11.0
def self.supports_metadata?
Puppet::Util::Package.versioncmp(rabbitmq_version, '3.11') >= 0
rescue Puppet::MissingCommand
# See comment on the definition of rabbitmqctl_list in rabbitmqctl_cli.rb;
# the same rationale applies here.
Puppet.debug('supports_metadata?: rabbitmqctl command not found; assuming rabbitmq is not installed')
false
end
def supports_metadata?
self.class.supports_metadata?
end
def self.vhost_list
run_with_retries do
if supports_metadata?
rabbitmqctl_list('vhosts', 'name,description,default_queue_type,tags', '-s')
else
rabbitmqctl_list('vhosts')
end
end
end

I would worry that even if you fix this issue, you may turn up other issues.

@thomasgoirand
Copy link
Author

Hi.

Well, I'm using this module in production under Debian 13 (aka: Trixie) with the patch I just sent plus a bit more (like puppetserver 8.4.0 support, ie: fixes to stop using toplevel facts that are now gone). Full list of patches here:

https://salsa.debian.org/openstack-team/puppet/puppet-module-puppetlabs-rabbitmq/-/tree/debian/epoxy/debian/patches?ref_type=heads

I can do the work to add all of my patches, but if you start refusing them it's going to be complicated...

As for the validation tests, I'm not sure how to fix them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants