I am attempting to have puppet (0.25.5-1.el5) update an already installed package when a new yum repo gets installed.
The basic image we have has package X installed at version 1.1 by default. In the available repos, version 1.1. is the most recent. I am installing a new repo which has package X at version 1.8 available. I would like to have both the installation of the new repo and the update of package X happen simultaneously. The code I have is as follows:
class repo {
yumrepo { "foorepo":
descr => 'the foo repo',
baseurl => 'http://path.to.foo/repos/centos/5/',
enabled => 1,
gpgcheck => 0,
}
}
class package_x {
package { "package_x":
provider => "yum",
ensure => "latest",
require => Yumrepo["foorepo"]
}
}
where the node is defined as:
node default {
include repo
include package_x
}
What I see happen is that when I run it the first time, puppet recognises that a new repo must be installed but, because the package is already available in a current repo, assumes that package_x is already at the latest version. If I run it a second time, it is then able to recognise that this new repo means that package_x must be updated to version 1.8.
I have played around with the notify and subscribe parameters but they don't seem to be applicable to a class. It seems that Puppet is evaluating the required updates against the current setup and therefore must apply the new repo before it is able to 'know' that a new version of package_x is available.
Am I missing a simple solution to this type of dependency issue? Has anybody found a setup that would allow this type of dependency to force the update of the package?
Thanks.