John, you left out too many details in how this is implemented. The require => Class["whatever"] on the percona package,
and the fact that the Package["mysql"] ensure => absent is INSIDE class 'whatever' and that it runs successfully the FIRST time, but then is trying to REMOVE percona. Please try to require => Package["whatever::mysql"] directly on the Package["percona-server"] definition, this should not try to re-evaluate the requirement for installing percona-server-server _ONCE IT IS ALREADY INSTALLED_ Read: http://docs.puppetlabs.com/learning/ordering.html On Wednesday, April 23, 2014 1:57:09 PM UTC-7, Jon Forrest wrote: > > I have an interesting problem (to me). I want to install Percona > mysql. This is easy. > But I also want to make sure regular MySQL isn't installed on the same > machine that's running Percona. > > To install Percona, I have a resource like > > package { > 'percona-client': > name => 'Percona-Server-client-55', > ensure => installed, > } > > To make sure MySQL isn't installed I have > > package { > 'mysql': > provider => "yum", > ensure => purged, > } > > The problem is that Puppet tries to remove Percona, instead of MySQL. > This is because the Percona rpm provides the mysql feature. By this I mean > the output from 'yum provides mysql' contains (edited): > > Percona-Server-client-55-5.5.36-rel34.2.el6.x86_64 : Percona Server - > Client > Repo : XXX > Matched from: > Other : mysql > > Percona-Server-client-55-5.5.36-rel34.2.el6.x86_64 : Percona Server - > Client > Repo : installed > Matched from: > Other : Provides-match: mysql > > Of course, trying to remove Percona fails because other things depend on > it, as they should. > > The only ideas I have for removing MySQL, and not Percona, are: > > 1) Use rpmrebuild to change what Percona provides > 2) Use something like (untested) > > exec { "/usr/bin/yum -y remove mysql": > onlyif => "/bin/rpm -qa |/bin/fgrep mysql" > > 3) Just presume that MySQL won't be installed in the first place. > I could do this but I'd like my modules to be more accepting and > not require a specially prepared system. > > Any suggestions? > > Jon Forrest > -- 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/9104350f-64bc-4985-945c-275029b21816%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
