Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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", } } –  Nick Palmer May 8 '13 at 8:30

1 Answer 1

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",
 }
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.