Hi everyone,
I have an interesting problem I think.
I'm trying to install MySQL on FreeBSD. This is what I have in my
init.pp of the module:
---------------- start ------------------
package { 'MySQL-server' :
name => $operatingsystem ? {
freebsd => 'mysql51-server',
debian => 'mysql-server-5.0',
default => 'mysql51-server',
},
ensure => installed,
}
----------------- end --------------------
When I run puppet this works fine, MySQL gets installed.
But, when I run it a second time I get an error:
debug: Puppet::Type::Package::ProviderFreebsd: Executing '/usr/sbin/
pkg_add -r mysql51-server'
err: /Stage[main]/Mysql-server/Package[pkgMySQL-server]/ensure: change
from absent to present failed: Execution of '/usr/sbin/pkg_add -r
mysql51-server' returned 1: pkg_add: package 'mysql-server-5.1.48' or
its older version already installed
I looks like Puppet is not able to figure out that MySQL 5.1 is
already installed. If I list the packages installed (with pkg_info) I
find MySQL there but it's not called "mysql51-server" but "mysql-
server-5.1.48". If I go back to my init.pp and change the name from
"mysql51-server" to just "mysql-server", it works again (i.e. it will
not try to install the package again). It is not possible to start
with just "mysql-server", because there is no package called just
"mysql-server".
My conclusion is that FreeBSD's inconsistent way of naming the
packages fools Puppet to think it's not installed. I've never written
a line of ruby-code so I could use some help here. Can anyone think of
a good workaround?
BTW - my current, and not so pretty workaround is to link mysql-
server.tbz to mysql51-server.tbz on my local FreeBSD-mirror-site.
Thanks,
Freddie
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.