On Monday, October 1, 2012 3:02:48 PM UTC-5, Duncan Hutty wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I want puppet to manage some packages. On CentOS, puppet correctly > uses the yum provider to manage rpms. Normally I can do: > > package { ...: > ensure => present > } > > but the rpms I want to install conflict with existing rpms. > > Ok, you say. so "ensure => present" on the ones I want and "ensure => > absent" on the ones to remove. > > How do I cope with the fact that there are other installed packages > that depend on the ones I want to remove? > > The new packages will fulfill the dependency as well, so effectively I > just want to force the transaction. >
No, you *never* want to do that. As soon as you do, you are no longer justified in having full confidence in your RPM database. Probably things work out ok, if you've been careful, at least, but there are gotchas even for the careful. The proper way to do this from the command line is to use "yum shell" to set up and run a transaction set that removes the unwanted RPMs and adds the replacements in the same go. Or perhaps you can allow the dependant packages to be uninstalled and reinstalled (supposing they are all managed by Puppet, or you're willing to make them so). > > Effectively, I want puppet/yum to execute ``rpm -e --nodeps``; can I > tell puppet to do it that way? Or do I need to find a workaround, such > as an exec? > > The Package type does not provide a mechanism to specify additional flags for provider actions. Furthermore, it manages packages one by one. If you need to automate this switch via Puppet, then you probably do need an Exec. John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/UxUtEsui_i0J. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.