Yes.
Your package declarations have a hidden inconsistency that Puppet is unable to diagnose. You specify that package "mysql-libs" must be purged, but that's not actually what you want, because packages mysql and mysql-server depend on mysql-libs. By ensuring mysql-libs purged, you force it and all packages that depend on it to be removed (if mysql-libs is present) every time the agent runs.
That's why mysql-5.1.66 and mysql-server-5.1.66 got removed. It is surely not what you actually want, even if the mysql-5.1.66 packages were still available in your configured repositories. (And this is yet another reason why the declaration of package "mysql-5.5.34" is useless.)
You have committed one of the classic Puppet blunders: writing manifests that focus on state transitions instead of on the desired target state. I say that because the only reason I can imaging for declaring mysql-libs purged is to facilitate downgrading mysql to version 5.1.66 from a later version.
There are several things you should do:
- Create and maintain a local package repository for at least those packages you depend upon, plus their dependencies. Myself, I maintain a complete local mirror of all the essential repositories I depend on. There are multiple advantages, but the most relevant one here is that you can avoid packages being yanked out from under you.
- Remove the inconsistency in your declarations.
There are several approaches to (2), but I'd recommend creating a custom fact to report the installed version of mysql-libs, and making its purge conditional on that value. The Puppet side might look like this:
class mysql {
$target_version = '5.1.66'
$target_release = '2.el6_3'
package { 'mysql': ensure => "${target_version}-${target_release)" }
# assumes that mysql-libs version must match mysql version;
# $::mysql_libs_version is a custom fact you must provide:
if $::mysql_libs_version != '' and versioncmp($target_version, $::mysql_libs_version) < 0 {
package { 'mysql-libs':
ensure => 'purged'
before => Package['mysql']
}
}
package { 'compat-mysql': ensure => 'absent' }
}
Note that there is no need for a resource relationship between Package['compat-mysql'] and Package['mysql'], because it doesn't matter in which relative order these resources are applied. Note also that there is no longer any declaration of a package "mysql-5.5.34"; it is unneeded.
Additionally, note that it is not normally necessary to explicitly specify a provider in your resource declarations.
See
http://docs.puppetlabs.com/guides/custom_facts.html for information about writing and distributing custom facts.
John