Repository navigation
Conversation
e275a43 to
7e105ba
Compare
miharp
left a comment
There was a problem hiding this comment.
I saw your slack question about using GH urls so I ran the Debian and RedHat branches of rabbitmq::install::rabbitmqadmin_ng on their own in Debian 12 and AlmaLinux 9 containers (OpenVox 8.34.0, puppet-archive 8.1.0), using rabbitmqadmin 2.34.0 and 2.35.0. Fresh installs work on both.
The inline comments cover what I found: changing rabbitmqadmin_ng_version doesn't upgrade an installed package, and the Debian download fails on arm64. Both suggestions are tested. I didn't run the module's spec suites against them.
FYI: the unit specs default to RabbitMQ 3.13, so this class doesn't look like it's compiled there. A 4.x context that checks the package's ensure and source would cover both issues.
| $rabbitmqadmin_url = "https://github.com/rabbitmq/rabbitmqadmin-ng/releases/download/v${$rabbitmqadmin_ng_version}/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb" | ||
| $rabbitmqadmin_checksum_url = "${rabbitmqadmin_url}.sha512" | ||
|
|
||
| archive::download { "/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb": | ||
| ensure => present, | ||
| url => $rabbitmqadmin_url, | ||
| digest_type => 'sha512', | ||
| digest_url => $rabbitmqadmin_checksum_url, | ||
| } | ||
|
|
||
| package { 'rabbitmqadmin': | ||
| source => "/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb", | ||
| require => Archive::Download["/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb"], | ||
| } |
There was a problem hiding this comment.
Two things from running this branch in Debian 12 containers (OpenVox 8.34.0, puppet-archive 8.1.0):
- Changing
rabbitmqadmin_ng_versiondownloads the new.debbut the old version stays installed, because the package has no version inensure. - On arm64 the download returns a 404.
$facts['os']['architecture']isaarch64there, but the asset is namedrabbitmqadmin_2.35.0_arm64.deb.
This fixes both. I tested it on amd64 and arm64 between 2.34.0 and 2.35.0:
| $rabbitmqadmin_url = "https://github.com/rabbitmq/rabbitmqadmin-ng/releases/download/v${$rabbitmqadmin_ng_version}/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb" | |
| $rabbitmqadmin_checksum_url = "${rabbitmqadmin_url}.sha512" | |
| archive::download { "/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb": | |
| ensure => present, | |
| url => $rabbitmqadmin_url, | |
| digest_type => 'sha512', | |
| digest_url => $rabbitmqadmin_checksum_url, | |
| } | |
| package { 'rabbitmqadmin': | |
| source => "/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb", | |
| require => Archive::Download["/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${facts['os']['architecture']}.deb"], | |
| } | |
| $deb_arch = $facts['os']['architecture'] ? { | |
| 'aarch64' => 'arm64', | |
| default => $facts['os']['architecture'], | |
| } | |
| $rabbitmqadmin_url = "https://github.com/rabbitmq/rabbitmqadmin-ng/releases/download/v${$rabbitmqadmin_ng_version}/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${deb_arch}.deb" | |
| $rabbitmqadmin_checksum_url = "${rabbitmqadmin_url}.sha512" | |
| $rabbitmqadmin_deb = "/var/lib/rabbitmq/rabbitmqadmin_${$rabbitmqadmin_ng_version}_${deb_arch}.deb" | |
| archive::download { $rabbitmqadmin_deb: | |
| ensure => present, | |
| url => $rabbitmqadmin_url, | |
| digest_type => 'sha512', | |
| digest_url => $rabbitmqadmin_checksum_url, | |
| } | |
| package { 'rabbitmqadmin': | |
| ensure => $rabbitmqadmin_ng_version, | |
| source => $rabbitmqadmin_deb, | |
| require => Archive::Download[$rabbitmqadmin_deb], | |
| } |
| package { 'rabbitmqadmin': | ||
| source => $rabbitmqadmin_url, | ||
| } |
There was a problem hiding this comment.
Same upgrade problem here: on AlmaLinux 9, changing rabbitmqadmin_ng_version does nothing once the package is installed. With the version in ensure, install, upgrade and downgrade all follow the parameter:
| package { 'rabbitmqadmin': | |
| source => $rabbitmqadmin_url, | |
| } | |
| package { 'rabbitmqadmin': | |
| ensure => "${rabbitmqadmin_ng_version}-1", | |
| source => $rabbitmqadmin_url, | |
| } |
7e105ba to
5d66fac
Compare
|
@miharp thank you very much, I added your suggestions (and you as co-author)
If you're speaking of |
|
On the FYI, I meant the unit spec, |
Uses 3.13 as a default, but CI/CD creates different jobs with different values of rabbitmq_version (see Or I am misunderstanding again 😅 |
5d66fac to
a5b1546
Compare
|
Easier to show than explain, so I opened a do-not-merge PR on my fork with an example: miharp#1 Its base is your current head, so the diff is only the tests: one context in Both unit jobs are green on the fork ( |
|
I ran this on real VMs to cover what the container tests can't: AlmaLinux 9.9 and Ubuntu 24.04, RabbitMQ 4.3.8, OpenVox 8.34.0 and 9.5.0, Works: In this PR
Beyond this PR, for the 4.x work
I haven't tested fixes for any of these. Happy to rerun the same checks on a later commit. |
a5b1546 to
a760840
Compare
|
Ok, I'll try to split this in multiple PRs: first rabbitmqadmin-ng install, then providers. PR
Install should be now limited to Linux OSes. It will be a problem with providers, but I don't see how to install
Noted, will be a problem for subsequent PRs for providers
Removed checksum check from URL, although I don't really like the idea Beyond this PR
(still working on the feedback) |
I'll try to merge it with 3.13 tests using conditions based on the version, so that the test run when relevant. For the unit specs it'll be a problem for the future PRs :D |
Install rabbitmqadmin-ng, will be used for providers Co-authored-by: miharp <miharp@users.noreply.github.com>
a760840 to
30fcbb8
Compare
Pull Request (PR) description
Install rabbitmqadmin-ng for RabbitMQ >= 4.0
This Pull Request (PR) fixes the following issues
n/a.