(I found a discussion from 6/22/09 on this topic, but that was a long time 
ago.)

Using Puppet 3.5.1 on CentOS 6.5 I recently created the following:

  package {
    [ "PackageKit"]:
      ensure => absent,
  }

However, when I ran Puppet, I got

Error: Execution of '/bin/rpm -e PackageKit-0.5.8-21.el6.x86_64' returned 
1: error: Failed dependencies:
        PackageKit = 0.5.8-21.el6 is needed by (installed) 
PackageKit-yum-0.5.8-21.el6.x86_64
        PackageKit = 0.5.8-21.el6 is needed by (installed) 
PackageKit-glib-0.5.8-21.el6.x86_64
        PackageKit is needed by (installed) 
PackageKit-yum-plugin-0.5.8-21.el6.x86_64

Notice that the provider is running '/bin/rpm' which explains the errors. 
So, I explicitly added
a provider, so that the resource definition is this:

 package {
    [ "PackageKit"]:
      provider => 'yum',
      ensure => absent,
  }

There was no change!!

In the discussion from 2009, somebody suggested using "purge" instead of 
"absent",
so I did. But although Puppet now uses yum, it does so in a very strange 
way:

Error: Could not update: Execution of '/usr/bin/yum -d 0 -e 0 -y install 
PackageKit-purge' returned 1: Error: Nothing to do
Wrapped exception:

This looks like a bug to me.

I ended up using

  exec { "/usr/bin/yum -y remove PackageKit":
        onlyif => "/bin/rpm -qa |/bin/fgrep PackageKit",
    }

but this is a step in the wrong direction.

Comments?

Jon Forreset

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2089be92-a912-4645-819c-d1da5c3d34da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to