Issue
I´m trying to resolve RPMs additional from an our own YUM-Repository. I declared the additional Yum-Repo in "/etc/yum.repos.d/" and running the command "yum install JDK-jdk.x86_64" the rpm installs succesfully.
But when using the following manifest from Puppet, Puppet doesn`t seem to look in the declared additional YUM-repository:
class tomcat7_rhel {
package { "sun-JDK-1.6.0":
ensure => latest,
require => Yumrepo["JDK-jdk.x86_64"]
#require => Package["JDK-jdk.x86_64"]
}
}
Running the agent with:
puppet agent --test --environment det
the Error looks as follows:
Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Package[sun-JDK-1.6.0] { require => Yumrepo[JDK-jdk.x86_64] }, because Yumrepo[JDK-jdk.x86_64] doesn't seem to be in the catalog Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
Currently I´m completly stuck, so any help would be appreciated.
Solution
try requiring a yum update on package installation to make sure you're getting your latest additions:
exec {"yum_update":
command => "yum update -y",
}
package { "sun-JDK-1.6.0":
ensure => latest,
require => [ Yumrepo["JDK-jdk.x86_64"], Exec["yum_update"] ],
}
Answered By - Chris Montanaro Answer Checked By - Candace Johnson (WPSolving Volunteer)