Jira (PUP-1198) Package type and provider need to consider `purged` and `absent` packages identical for yum and similar providers

2 views
Skip to first unread message

Moses Mendoza (JIRA)

unread,
Oct 31, 2016, 5:31:05 PM10/31/16
to puppe...@googlegroups.com
Moses Mendoza commented on Bug PUP-1198
 
Re: Package type and provider need to consider `purged` and `absent` packages identical for yum and similar providers

this was fixed in PUP 4.2

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Josh Cooper (Jira)

unread,
Nov 11, 2021, 12:52:03 PM11/11/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Puppet / Bug PUP-1198
Change By: Josh Cooper
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> {code:puppet}
package { <package>: ensure => purged }
</pre> {code}

However, puppet prints this into the logs:

<pre> {noformat}
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> {noformat}

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.
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages