Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-8664

rpm package provider is too specific

    Details

    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Story Points:
      1
    • Sprint:
      PR - 2019-04-03, PR - 2019-04-17, PR - 2019-05-02, PR - 2019-05-15
    • Method Found:
      Customer Feedback
    • CS Priority:
      Normal
    • CS Frequency:
      1 - 1-5% of Customers
    • CS Severity:
      3 - Serious
    • CS Business Value:
      3 - $$$$
    • CS Impact:
      Hide
      The rpm provider should allow for a single run to ensure absent one package and ensure present another. The fact this fails in any case is a bug worth fixing.

      There is already a PR attached.
      Show
      The rpm provider should allow for a single run to ensure absent one package and ensure present another. The fact this fails in any case is a bug worth fixing. There is already a PR attached.
    • Release Notes:
      Enhancement
    • Release Notes Summary:
      When using ensure => absent, you no longer need to specify version or build number to have the package removed.
    • QA Risk Assessment:
      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
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sebastian.miclea Sebastian Miclea
                Reporter:
                tom.kishel Thomas Kishel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support