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

Yum Provider Does Not Properly Update Package Using Version Range and Install Options

    XMLWordPrintable

Details

    • Phoenix
    • 2
    • Phoenix 2022-04-27
    • Needs Assessment
    • jplindquist
    • Enhancement
    • Yum provider now accepts disablerepo, enablerepo, disableexcludes install options if a range is specified.
    • Needs Assessment

    Description

      Puppet Version: 7.14.0
      Puppet Server Version: N/A
      OS Name/Version: CentOS 7

      The yum provider does not appear to pass in the install_options (disablerepo, enablerepo, disableexcludes) when listing available packages if a version range is specified

      https://github.com/puppetlabs/puppet/blob/7.14.0/lib/puppet/provider/package/yum.rb#L228-L231

      We have a custom / internal repo which has excludes enabled so packages are not updated during normal patching, but use install options to ensure the package is present during initial configurations, and would like to be able to use the version ranges to specify a minimum version to upgrade to when code is changed as well.

      Desired Behavior: The provider properly appends the install_options to the yum list command like it does with update and other commands currently

      i.e.

      // Pseudo Example
      yumrepo { "myrepofile":
        ensure  => present,    
        name    => "myrepofile",
        descr   => "myrepofile",
        baseurl => "https://my.repo.file",
        enabled => '1',
        exclude => 'mypackage*',
      }
       
      package { 'mypackage':
        ensure          => ">=1.2.3",
        install_options => [     
          {
            '--disableexcludes' => "myrepofile"
          },
        ],
      }

       

      /usr/bin/yum list <package> --showduplicates --disableexcludes=<repo> | sed -e '1,/Available Packages/ d' | awk '{print $2}'

      Sample of where this is currently done during check-update: https://github.com/puppetlabs/puppet/blob/7.14.0/lib/puppet/provider/package/yum.rb#L109-L115

       

      Actual Behavior:

      Available versions are listed without disablerepo, enablerepo, disableexcludes from install_options that are necessary to properly list all available updates.

       

      /usr/bin/yum list <package> --showduplicates | sed -e '1,/Available Packages/ d' | awk '{print $2}'

      Resulting in no available packages from myrepofile because it is excluded by default

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jplindquist Jon-Paul Lindquist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support