I am using PackageCloud package to install Rabbitmq using Ansible. When I installed using PackageCloud, some Rabbitmq servers run version 3.8.19 and some run 3.9.1. But I am trying to pin Rabbitmq version so that all Rabbitmq servers in all environments have the same version 3.8.19.
I added a file too /etc/apt/preferences.d/rabbitmq
with the content
Package: rabbitmq-server
Pin: version 1:3.8.19
Pin-Priority: 1000
as mentioned in RMQ documentation but it still installs the latest version 3.9.2 instead of 3.8.19.
2
Answers
Just add a conditional check on the version which is present in the file you placed on the system:
After the configured the repositories you should have something like:
then you can pin the version using:
now the Candidate is the right one:
just install it and then: