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

Package type and provider need to consider `purged` and `absent` packages identical for yum and similar providers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      I have a package resource that I want to remove, including all of its dependencies. On Red Hat systems, this is done by "yum -y erase <package>".

      The corresponding puppet code is:

      <pre>
      package

      { <package>: ensure => purged }

      </pre>

      However, puppet prints this into the logs:

      <pre>
      debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q abrt --nosignature --nodigest --qf %

      {NAME}

      %|EPOCH?{%{EPOCH}}:

      {0}

      | %

      {VERSION}

      %

      {RELEASE}

      %

      {ARCH}

      '
      debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -y erase abrt'
      notice: /Stage[main]/Global/Package[abrt]/ensure: created
      </pre>

      The notice is clearly incorrect, as there's nothing that's been created. In fact, it repeatedly prints this notice and runs the "yum erase" command long after the package has actually been removed.

      Both of these behaviors are incorrect, and are caused by the RAL returning `absent` as the package state, while `purged` is required for the resource to settle.

      My expectation is:

      1. Logged notices for purged resources should not describe anything as being "created".
      2. Puppet should only run the "yum erase" command only if the package query ("rpm -q") returns a valid result.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  redmine.exporter redmine.exporter
                • Votes:
                  7 Vote for this issue
                  Watchers:
                  13 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Zendesk Support