having issue when trying to install java using rpm

62 views
Skip to first unread message

Supriya Uppalapati

unread,
Jun 13, 2014, 1:17:11 PM6/13/14
to puppet...@googlegroups.com

Hi,

I am getting the issue when i modifyied the code like this

class java_rpm::install {
$version = hiera("javaversion")

package { $version:
provider => rpm,
source => "puppet:///development/java_rpm/files/$version",
ensure => installed,
}
}
MY file is here:
pwd
/etc/puppetlabs/puppet/environments/development/modules/java_rpm/files

In my /var/lib/hiera

classes:
- 'cis'
- 'java_versions'
- 'java_rpm'

javaversion: jdk-7u25-linux-x64.rpm

 

Error: Execution of '/bin/rpm -i puppet:///development/java_rpm/files/jdk-7u25-linux-x64.rpm' returned 1: error: open of puppet:///development/java_rpm/files/jdk-7u25-linux-x64.rpm failed: No such file or directory

Error: /Stage[main]/Java_rpm::Install/Package[jdk-7u25-linux-x64.rpm]/ensure: change from absent to present failed: Execution of '/bin/rpm -i puppet:///development/java_rpm/files/jdk-7u25-linux-x64.rpm' returned 1: error: open of puppet:///development/java_rpm/files/jdk-7u25-linux-x64.rpm failed: No such file or directory

Let me know

Jason Antman

unread,
Jun 17, 2014, 7:51:59 AM6/17/14
to puppet...@googlegroups.com
"That's not how it works".

In the output below, you can clearly see that Puppet is executing `/bin/rpm -i puppet:///development/java_rpm/files/jdk-7u25-linux-x64.rpm`. Why would that work? "puppet:///" means nothing to RPM, and "puppet:///" is not a valid 'source' for the Package type.

You have two options:
1) the correct option, create a Yum repository somewhere with the package in it, and install from that.
2) Serve that file over HTTP from somewhere, and install from there.
2) Use a File resource first to put that on the machine, and have the Package resource install that, and reference that path.

I'd highly recommend against doing it this way. There's no reason that a giant binary (like an RPM) should be inside a puppet module - it means your source control repo for puppet (or that module) will be huge, and Puppet isn't really designed to serve large files. There are existing methods of deploying RPMs (Yum).

-Jason
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/c25a25f1-2aaa-4596-a8d9-b66a8331fcbc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages