puppet-collectd
puppet-collectd copied to clipboard
There is no way to actually control the version of collect being installed.
Affected Puppet, Ruby, OS and module versions/distributions
- Puppet: 4.3.2
- Ruby: 2.1.8
- Distribution: CentOS 7.3
- Module version: latest
How to reproduce (e.g Puppet code you use)
class { '::collectd': minimum_version => '5.4.1-1' }
What are you seeing
I have a newer version of collectd in my local yum repo. So on a brand new install, puppet is installing the latest version of collectd, and NOT the version I have specified.
As a result when puppet tries to install collectd-java at version 5.4.1-1 puppet errors out because collectd version 5.7.1-1 is already installed and it wants collectd-5.4.1-1.
What behaviour did you expect instead
I would expect the module to install the version I have specified.
Output log
If i run puppet with --debug on a new machine I can see it installing collectd with no version which means it's going to get the latest version and not the version I defined.
Debug: Executing: '/bin/rpm -q collectd --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n' Debug: Executing: '/usr/bin/yum -d 0 -e 0 -y list collectd' Debug: Packagecollectd: Ensuring => present Debug: Executing: '/usr/bin/yum -d 0 -e 0 -y install collectd' Notice: /Stage[main]/Collectd::Install/Package[collectd]/ensure: created Debug: /Stage[main]/Collectd::Install/Package[collectd]: The container Class[Collectd::Install] will propagate my refresh event Debug: Class[Collectd::Install]: The container Stage[main] will propagate my refresh event
To specify an exact version to install, you'll want to use the package_ensure parameter.
https://github.com/voxpupuli/puppet-collectd/blob/f0426c6054cb6e55ba9afee9369245b4adb4422c/manifests/init.pp#L16
minimum_version is useful if you don't want to run puppet twice. See https://github.com/voxpupuli/puppet-collectd#puppet-needs-two-runs-to-correctly-write-my-conf-why
minimum_version does not work properly with upgrades (changing package_ensure to a version or latest).
Example: From a currently installed 4.10, change minimum_version to 5.7 and package ensure to latest. Two puppet runs are required to fully apply the configuration.
collectd_version is itempotent (and thus collectd_version_real).