Ask Your Question
1

Puppet doesn't User zypper to remove packages?

asked 2014-08-22 09:19:06 -0500

derekmceachern gravatar image

Trying to use the package provider to manage packages on Suse system.

Using "ensure => present" works as expected and packages get installed using the zypper package manager.

However, using "ensure => absent" doesn't work. For package removal Puppet uses "rpm -e" instead of zypper which fails since it does not resolve dependencies.

Anyone else able to remove packages on a Suse system successfully?

Why doesn't Pupet use zypper for package removal?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-08-22 11:34:21 -0500

spuder gravatar image

This appears to be how the puppet provider is intended to work for sles.

I tried by installing autoconf (which has a depencency on m4)

puppet apply -v -e "class foo { package {'autoconf': ensure => present } } include foo" --debug

I then attempted to remove the package 'm4' and got the same error you are describing

puppet apply -v -e "class foo { package {'m4': ensure => absent } } include foo" --debug

Even if I try and force puppet to use the 'puppet provider', it still uses rpm -e

puppet apply -v -e "class foo { package {'m4': ensure => absent, provider => zypper } } include foo" --debug

The possible solutions are:

Remove parent packages before children packages

puppet apply -v -e "class foo { 
package { 'm4': 
  ensure => absent,
  require => Package['autoconf'] 
} 
package { 'autoconf': 
  ensure => absent
} 
} include foo" --debug

Open feature request at puppetlabs

edit flag offensive delete link more

Comments

Thanks @spudder. I really don't want to have to do that and was hoping that there was a good reason it uses rpm vs zypper for removal.

derekmceachern gravatar imagederekmceachern ( 2014-08-22 13:37:47 -0500 )edit

SLES support seems to be low priority. I would open a ticket to see if they will improve the sles support.

spuder gravatar imagespuder ( 2014-09-02 11:33:09 -0500 )edit

Opened PUP-3149 last week for this.

derekmceachern gravatar imagederekmceachern ( 2014-09-02 11:55:10 -0500 )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

Stats

Asked: 2014-08-22 09:19:06 -0500

Seen: 312 times

Last updated: Aug 22 '14