Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Done
-
PUP 5.3.5
-
Night's Watch
-
1
-
PR - 2019-04-03, PR - 2019-04-17, PR - 2019-05-02, PR - 2019-05-15
-
Customer Feedback
-
Normal
-
1 - 1-5% of Customers
-
3 - Serious
-
3 - $$$$
-
-
Enhancement
-
When using ensure => absent, you no longer need to specify version or build number to have the package removed.
-
Needs Assessment
Description
Puppet Version: 5.3.5 (and older)
Puppet Server Version: N/A
OS Name/Version: Centos/Redhat
The uninstall method in the rpm package provider is more specific than the package resource it is uninstalling, and uses a cache that can become out of date by the time it executes.
Desired Behavior:
Unconditionally uninstall a package when conditions are not specified.
Actual Behavior:
Example:
package { 'cronie-anacron': |
ensure => absent,
|
require => Package['cronie-noanacron'] |
}
|
|
package { 'cronie-noanacron': |
ensure => installed,
|
}
|
yum[3546]: Updated: cronie-anacron-1.4.11-19.el7.x86_64 |
yum[3546]: Updated: cronie-1.4.11-19.el7.x86_64 |
yum[3546]: Installed: cronie-noanacron-1.4.11-19.el7.x86_64 |
|
puppet-agent[1371]: (/Stage[main]/Package[cronie-noanacron]/ensure) created |
puppet-agent[1371]: Execution of '/usr/bin/rpm -e cronie-anacron-1.4.11-17.el7.x86_64' returned 1: error: package cronie-anacron-1.4.11-17.el7.x86_64 is not installed |
puppet-agent[1371]: (/Stage[main]/Package[cronie-anacron]/ensure) change from '1.4.11-17.el7' to 'absent' failed: Execution of '/usr/bin/rpm -e cronie-anacron-1.4.11-17.el7.x86_64' returned 1: error: package cronie-anacron-1.4.11-17.el7.x86_64 is not installed |
To reset the test environment after that puppet run, download cronie-1.4.11-14.el7.x86_64.rpm and cronie-anacron-1.4.11-14.el7.x86_64.rpm and run:
rpm -e cronie cronie-noanacron crontabs ; yum install -y cronie-* ; rpm -qa | grep cron ; puppet agent -t ; rpm -qa | grep cron
|