puppet-rabbitmq icon indicating copy to clipboard operation
puppet-rabbitmq copied to clipboard

Module always installs RabbitMQ 3.5.7 even if pinned at 3.6

Open witchbutter opened this issue 6 years ago • 3 comments

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 avatar Jan 11 '19 21:01 witchbutter

@witchbutter Have you tried using repos_ensure => True instead of calling the apt module directly?

wyardley avatar Jan 28 '19 19:01 wyardley

@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:

  1. Do not use rabbitmq::repos_ensure and continue to use your apt::source definition, but add the apt::source::pin property by hand.
  2. 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.

func0der avatar Feb 16 '19 23:02 func0der

@witchbutter, @func0der We fixed issue #779. Could you please check again, based on the master branch?

dhoppe avatar May 02 '19 19:05 dhoppe