Ask Your Question

What is the best practise to purge an installed package?

asked 2014-10-04 14:33:47 -0600

debinix gravatar image

updated 2014-10-05 05:04:33 -0600

I'm in the process securing a HP server running OracleLinux 6.5 (compatible with Redhat/Centos 6.5). On the host I run puppet-server/client version 3.7.

What is the best practice to remove an installed package?

In the quest with my objective I purge a number of packages in my site.pp manifest like so:

class { hp_remove_rpms : rpms => [ "nfs-utils", "rpcbind", "cups" ] }

This class, hp_remove_rpms is very simple:

class hp_remove_rpms ( $rpms ='' ) {
    package { $rpms :
               ensure => purged,
        allow_virtual => true,

Although this works, but when the client runs a second time (in verbose mode):

/usr/bin/puppet agent --no-daemonize --verbose --onetime

Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for ol65.home.tld
Info: Applying configuration version '1412450275'
Notice: /Stage[main]/Hp_remove_rpms/Package[nfs-utils]/ensure: created
Notice: /Stage[main]/Hp_remove_rpms/Package[cups]/ensure: created
Notice: /Stage[main]/Hp_remove_rpms/Package[rpcbind]/ensure: created
Notice: Finished catalog run in 11.02 seconds

This does look like puppet is doing some unnecessary processing. Despite that the actual puppet run say created nothing is really created.

Thanks for any input. /Bertil

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-10-05 03:13:28 -0600

jonn gravatar image

This happens when you specify ensure => purged - it's a long-standing issue. It's on Puppet Labs' radar (see for example PUP-1295) but I don't think there's a fix as yet.

edit flag offensive delete link more


Hi john, thanks for the hint to the yum provider issue report. I guess Debian based hosts, with apt provider is not plagued by this.

debinix gravatar imagedebinix ( 2014-10-05 05:08:23 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-04 14:31:05 -0600

Seen: 1,328 times

Last updated: Oct 05 '14