Module always installs RabbitMQ 3.5.7 even if pinned at 3.6
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 5.5.8
- Module version: 8.4.1
How to reproduce (e.g Puppet code you use)
require apt
# Rabbit MQ stable repo
apt::source {'rabbitmq':
comment => 'RabbitMQ Stable Repository',
location => 'https://dl.bintray.com/rabbitmq/debian',
release => $facts['os']['distro']['codename'],
repos => 'main',
architecture => 'amd64',
key => {
id => '0A9AF2115F4687BD29803A206B73A36E6026DFCA',
source => 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc',
},
include => {
'deb' => true,
},
notify => Exec['force refresh apt for rabbit'],
before => Package['rabbitmq-server'],
}
class { 'rabbitmq':
package_ensure => 'latest',
package_apt_pin => '3.6.*',
}
What are you seeing
The module always installs version 3.5.7 then on a subsequent run upgrades to the latest 3.6 version in this case 3.16.6. Once upgraded the fact rabbitmq_version still reports the version as 3.5.7 for no apparent reason.
What behaviour did you expect instead
Install a version of 3.6 out of the gate. There is really no reason for me not be able to specify the repo within the rabbitmq forge module itself, but since there seems to be no facility to do that I am also use the apt module.
@witchbutter Have you tried using repos_ensure => True instead of calling the apt module directly?
@witchbutter You are using rabbitmq::package_apt_pin pin wrong.
rabbitmq::package_apt_pin is supposed to give the priority with which the source you define, should be ranked during installation via apt.
Basically, you should put 1000 in rabbitmq::package_apt_pin.
Like @wyardley mentioned, you pinning is not going to workig without $repos_ensure being set to true. If you'd do that, you could remove your apt::source definition, because you can do this all with rabbitmq module configuraiton:
rabbitmq::package_gpg_key: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
rabbitmq::repos_ensure: true
rabbitmq::package_apt_pin: '1000'
# @todo: Remove when pinning in rabbitmq module is fixed.
rabbitmq::package_ensure: '3.6*'
rabbitmq::repo::apt::key: '0A9AF2115F4687BD29803A206B73A36E6026DFCA'
rabbitmq::repo::apt::location: https://dl.bintray.com/rabbitmq
rabbitmq::repo::apt::repos: rabbitmq-server-v3.6.x erlang-20.x # Only use rabbitmq 3.6 and erlang versions compatible with it.
The hiera code above SHOULD install the 3.6 version of rabbitmq, but it does not, because there is a hard coded pinning to packagecloud.io in the module (#779, go and vote on that bug pls.)
So you got two choices:
- Do not use
rabbitmq::repos_ensureand continue to use yourapt::sourcedefinition, but add theapt::source::pinproperty by hand. - Use packagecloud. Downside with that is, that is does not seem to be possible to properly control the erlang version. I had issues with that constellation before, that's why i am using bintray.
@witchbutter, @func0der We fixed issue #779. Could you please check again, based on the master branch?