4

I am using puppet on CentOS for the first time.

I have the following in one of my .pp files:

package {"openjdk-6-jdk":
    ensure => installed,
}

Which generates the following error when applied:

Error: Execution of '/usr/bin/yum -d 0 -e 0 -y install openjdk-6-jdk' returned 1: Error: Nothing to do

Error: /Stage[main]/Play/Package[openjdk-6-jdk]/ensure: change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install openjdk-6-jdk' returned 1: Error: Nothing to do

Swapping installed for latest yields the same result.

package {"openjdk-6-jdk":
    ensure => latest,
}

How do I tell puppet that yum returning 1 here is okay?

I figured the puppet yum adapter would know how to handle this result code already.

This seems super basic and something that should "just work".

This is on Centos 6.3 with puppet 3.1.1-1.el6

1
  • Actually it is the yum response that threw me off. I am bringing this repo over from Ubuntu and I didn't realize the package name is different. The yum error message actually means the package name is wrong for CentOS, but is not very helpful in this regard. By adapting the name I was able to get it to install. package {"openjdk-6-jdk": ensure => installed, name => $operatingsystem ? { Ubuntu => "openjdk-6-jdk", CentOS => "java-1.6.0-openjdk", } } May 8, 2013 at 8:30

1 Answer 1

7

As posted in my comment, the package name was wrong. Here is how I fixed it to install on Ubuntu and CentOS.

package {"openjdk-6-jdk":
 ensure => installed,
 name => $operatingsystem ? {
   Ubuntu => "openjdk-6-jdk",
   CentOS => "java-1.6.0-openjdk",
 }
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .