Hi Adam,

Indeed, I forgot to mention it.

The behavior of Rabbit 4.x is different from 3.x, as in, if not being explicit, nodes wont be disk nodes. Keeping all nodes writing to disk is important when restarting daemons. Which is why there's this patch.

Also, the original fix was wrong, and I rewrote fix-list_users-provider.patch. I tested it more, and I'm sure it's working as expected now.

Let me know if it's ok for an upload,
Cheers,

Thomas Goirand (zigo)
diff -Nru puppet-module-puppetlabs-rabbitmq-8.5.0/debian/changelog 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/changelog
--- puppet-module-puppetlabs-rabbitmq-8.5.0/debian/changelog    2025-05-27 
15:02:16.000000000 +0200
+++ puppet-module-puppetlabs-rabbitmq-8.5.0/debian/changelog    2025-08-21 
16:15:57.000000000 +0200
@@ -1,3 +1,11 @@
+puppet-module-puppetlabs-rabbitmq (8.5.0-8+deb13u1) trixie; urgency=medium
+
+  * fix-list_users-provider.patch: also handle the case when there's no users
+    at all.
+  * Add setup-all-nodes-as-disk-nodes.patch.
+
+ -- Thomas Goirand <[email protected]>  Thu, 21 Aug 2025 16:15:57 +0200
+
 puppet-module-puppetlabs-rabbitmq (8.5.0-8) unstable; urgency=medium
 
   * Add trixie-support.patch.
diff -Nru 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/fix-list_users-provider.patch
 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/fix-list_users-provider.patch
--- 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/fix-list_users-provider.patch
        2025-05-27 15:02:16.000000000 +0200
+++ 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/fix-list_users-provider.patch
        2025-08-21 16:15:57.000000000 +0200
@@ -1,16 +1,27 @@
 Description: Fix list_users provider
 Author: Thomas Goirand <[email protected]>
-Forwarded: no
+Forwarded: https://github.com/voxpupuli/puppet-rabbitmq/pull/1060
 Last-Update: 2025-05-29
 
---- 
puppet-module-puppetlabs-rabbitmq-8.5.0.orig/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
-+++ 
puppet-module-puppetlabs-rabbitmq-8.5.0/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
-@@ -15,7 +15,7 @@ Puppet::Type.type(:rabbitmq_user).provid
+Index: 
puppet-module-puppetlabs-rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
+===================================================================
+--- 
puppet-module-puppetlabs-rabbitmq.orig/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
++++ 
puppet-module-puppetlabs-rabbitmq/lib/puppet/provider/rabbitmq_user/rabbitmqctl.rb
+@@ -15,7 +15,16 @@ Puppet::Type.type(:rabbitmq_user).provid
        rabbitmqctl_list('users')
      end
  
 -    user_list.split(%r{\n}).map do |line|
-+    user_list.split(%r{\n})[1..-1].map do |line|
++    lines = user_list.split(%r{\n})
++
++    # Skip the header lines in RabbitMQ 4.x
++    # Skip "Listing users ..." and "user    tags" lines
++    while lines.any? && (lines.first =~ %r{^Listing users} || lines.first =~ 
%r{^user\s+tags} || lines.first.strip.empty?)
++      lines.shift
++    end
++
++    # Process remaining lines (should be user data)
++    lines.map do |line|
        raise Puppet::Error, "Cannot parse invalid user line: #{line}" unless 
line =~ %r{^(\S+)\s+\[(.*?)\]$}
        user = Regexp.last_match(1)
        tags = Regexp.last_match(2).split(%r{,\s*})
diff -Nru puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/series 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/series
--- puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/series       
2025-05-27 15:02:16.000000000 +0200
+++ puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/series       
2025-08-21 16:15:57.000000000 +0200
@@ -4,3 +4,4 @@
 increase-rabbitmq-timeout.patch
 trixie-support.patch
 fix-list_users-provider.patch
+setup-all-nodes-as-disk-nodes.patch
diff -Nru 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/setup-all-nodes-as-disk-nodes.patch
 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/setup-all-nodes-as-disk-nodes.patch
--- 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/setup-all-nodes-as-disk-nodes.patch
  1970-01-01 01:00:00.000000000 +0100
+++ 
puppet-module-puppetlabs-rabbitmq-8.5.0/debian/patches/setup-all-nodes-as-disk-nodes.patch
  2025-08-21 16:15:57.000000000 +0200
@@ -0,0 +1,25 @@
+Description: Setup all nodes as disk nodes
+ In most production setups, it is advised to set all nodes as disk nodes
+ bacause of:
+  * Simplicity – all nodes behave the same; no special recovery procedures.
+  * Resilience – if one disk node fails, you don’t risk being left with
+    only RAM nodes (which could cause data loss if all RAM nodes restart).
+  * Operational flexibility – you can remove or add nodes without worrying
+    about “last disk node” constraints.
+  * Modern RabbitMQ performance – RAM nodes used to help in early versions
+    (pre-3.x) when Mnesia disk I/O was slow, but with current disk and SSD
+    speeds, the performance difference is often negligible.
+Author: Thomas Goirand <[email protected]>
+Forwarded: no
+Last-Update: 2025-08-11
+
+--- puppet-module-puppetlabs-rabbitmq-8.5.0.orig/templates/rabbitmq.config.erb
++++ puppet-module-puppetlabs-rabbitmq-8.5.0/templates/rabbitmq.config.erb
+@@ -16,6 +16,7 @@
+ <% end -%>
+ <% if @config_cluster -%>
+     {cluster_nodes, {[<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" 
}.join(', ') %>], <%= @cluster_node_type %>}},
++    {rabbit, [{disk_nodes, [<%= @cluster_nodes.map { |n| "\'rabbit@#{n}\'" 
}.join(', ') %>]}]},
+     {cluster_partition_handling, <%= @cluster_partition_handling %>},
+ <% end -%>
+     {tcp_listen_options, [

Reply via email to