| When installing a package using the yum package provider we can end-up in a situation where a package is installed from a distinct epoch even though we didn't specify an epoch. Trying to ensure another version, the comparison method can end-up giving the wrong result depending on package version, epoch and order of parameters: https://github.com/puppetlabs/puppet/blob/master/lib/puppet/util/rpm_compare.rb#L167 This can be reproduces using `python-docker-pycreds` package on a redhat7 box. available versions: 1.10.6-1.el7, 1.10.6-3.el7 , 1.10.6-4.el7, 1:0.3.0-7.el7 installed version: 1:0.3.0-7.el7 running:
❯ puppet resource package python-docker-pycreds ensure='1.10.6-3.el7' provider=yum |
results in trying to use `update` flag with an older version:
Debug: Package[python-docker-pycreds](provider=yum): Upgrading package python-docker-pycreds from version 1:0.3.0-11.el7 to 1.10.6-3.el7 Debug: Executing: ‘/usr/bin/yum -d 0 -e 0 -y update python-docker-pycreds-1.10.6-3.el7’ Debug: Executing: ’/usr/bin/rpm -q python-docker-pycreds --nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} %{RELEASE} %{ARCH}\n’ Debug: Cannot parse 1.10.6-3.el7 as a RPM version range Error: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead Error: /Stage[main]/Main/Package[python-docker-pycreds]/ensure: change from ‘1:0.3.0-11.el7’ to ‘1.10.6-3.el7’ failed: Could not update: Failed to update to version 1.10.6-3.el7, got version 1:0.3.0-11.el7 instead
|
|