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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • None
    • None

    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:

      package { <package>: ensure => purged }
      

      However, puppet prints this into the logs:

      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
      

      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

            People

              Unassigned Unassigned
              redmine.exporter redmine.exporter
              Votes:
              7 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support