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

Check if package is installed before enforcing configured version

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
    • Template:
    • Team:
      Night's Watch
    • Sprint:
      NW - 2020-08-18, NW - 2020-09-01, NW - 2020-09-16, NW - 2020-09-30
    • Zendesk Ticket IDs:
      40361
    • Zendesk Ticket Count:
      1
    • QA Risk Assessment:
      Needs Assessment

      Description

      Customer has asked me to create a feature request to allow them to check if a package is installed before puppet enforces the configured version.

      For example, customer would like to be able to do something like this:

      $packages =

      {   'puppet' => \{ ensure => '6.14.0-1.el7' }

      ,
        'ntp' => { ensure => '1.5.3-1' },
      }

      keys($pkg_hash).each |Integer $index, String $pkg| {
        if ! $facts['_puppet_inventory_1']['packages'][$pkg]['1']

      {     $upgrade=undef   }

        elsif versioncmp($facts['_puppet_inventory_1']['packages'][$pkg]['1'], ${attributes['ensure']}) == "1"

      {     $upgrade=False   }

        elsif versioncmp($facts['_puppet_inventory_1']['packages'][$pkg]['1'], ${attributes['ensure']}) == "-1"

      {     $upgrade=True   }

      if ($upgrade == undef) or ($upgrade) {
        package

      { $pkg:     ensure => $attributes['ensure'],   }

      }
      }

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              luchian.nemes Luchian Nemes
              Reporter:
              corey.benefrayim Corey Benefrayim
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support