trying to install jdk1.7 using rpm in a different directory

226 views
Skip to first unread message

Supriya Uppalapati

unread,
Jun 10, 2014, 3:06:32 PM6/10/14
to puppet...@googlegroups.com
Hi,
 
I am trying to install jdk1.7.0_25 using rpm in /u01/app/oracle/product/jdk1.7.0_25/. I downloaded rpm from oracle.
 
Here is my code
 
class java_rpm {
 package { "jdk7u25":
 provider => rpm,
 install_options => ['-ivh --prefix=/u01/app/oracle/product/jdk1.7.0_25/'],
 source => '/etc/puppetlabs/puppet/environments/development/modules/java_rpm/files/jdk-7u25-linux-x64.rpm',
 ensure => installed,
}
}

 
I am having this issue.
 
Error: Execution of '/bin/rpm -i "-ivh --prefix=/u01/app/oracle/product/jdk1.7.0_25/" /etc/puppetlabs/puppet/environments/development/modules/java_rpm/files/jdk-7u25-linux-x64.rpm' returned 1: error: open of -ivh\ --prefix=/u01/app/oracle/product/jdk1.7.0_25/ failed: No such file or directory
Error: /Stage[main]/Java_rpm/Package[jdk7u25]/ensure: change from absent to present failed: Execution of '/bin/rpm -i "-ivh --prefix=/u01/app/oracle/product/jdk1.7.0_25/" /etc/puppetlabs/puppet/environments/development/modules/java_rpm/files/jdk-7u25-linux-x64.rpm' returned 1: error: open of -ivh\ --prefix=/u01/app/oracle/product/jdk1.7.0_25/ failed: No such file or directory
 
 Please Help me

Spencer Krum

unread,
Jun 10, 2014, 5:40:08 PM6/10/14
to puppet...@googlegroups.com
If your goal is to install java into a nonstandard directory... why not just pull down the jdk tarball and untar that?


--
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/6ad85513-4e6c-43ef-90be-01d16fdd53df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Spencer Krum
(619)-980-7820

Supriya Uppalapati

unread,
Jun 10, 2014, 5:48:07 PM6/10/14
to puppet...@googlegroups.com
Hi,
 
My requirement says to use rpm based. Can we use install_options in puppet-enterprise 3.2 versions. If I do it manually it is installing In specifiyed location. But when I am using installed_options in puppet it is throwing me error
 
Let me know
 
Appreciate your help


--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/TtCoAlZ4vqE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CADt6FWPK8LCN8cd_X0kZY%3DHPSKZ_Z2D9rzhLV%3DvvJ71hWAHaRg%40mail.gmail.com.

Spencer Krum

unread,
Jun 10, 2014, 5:57:10 PM6/10/14
to puppet...@googlegroups.com
I have no experience with using install_options to install an rpm into a separate directory. Sorry.



For more options, visit https://groups.google.com/d/optout.



--
Spencer Krum
(619)-980-7820

Supriya Uppalapati

unread,
Jun 11, 2014, 12:03:16 PM6/11/14
to puppet...@googlegroups.com
Hi,
 
The answer for installing java using rpm in different locations is
class java_rpm {
 $version = 'jdk-7u25-linux-x64.rpm'
 package { $version:
 provider => rpm,
#exec {"$version":
 install_options => ['-vh','--prefix=/u01/app/oracle/product/java'],
 #owner => oracle,
 #group => oinstall,
 #mode => 0755,
# command => "rpm -ivh --prefix=/u01/app/oracle/product/java jdk-7u25-linux-x64.
rpm",
 source => "/etc/puppetlabs/puppet/environments/development/modules/java_rpm/fil
es/jdk-7u25-linux-x64.rpm",
ensure => installed,
}
file {"/u01/app/oracle/product/java":
# ensure => present,
 owner  => 'oracle',
 group  => 'oinstall',
# source => "/u01/app/oracle/product/java",
 recurse => true,
 mode => 755,
}
}
 
This code is working fine for me


jcbollinger

unread,
Jun 11, 2014, 12:59:55 PM6/11/14
to puppet...@googlegroups.com


On Wednesday, June 11, 2014 7:03:16 AM UTC-5, Supriya Uppalapati wrote:
Hi,
 
The answer for installing java using rpm in different locations is
class java_rpm {
 $version = 'jdk-7u25-linux-x64.rpm'
 package { $version:
 provider => rpm,
#exec {"$version":
 install_options => ['-vh','--prefix=/u01/app/oracle/product/java'],


I'm glad this is working for you.

I do note, however, that it is not a general-purpose solution, as only RPMs that have been built with relocation support (which is not the default) can be relocated that way.


John

Reply all
Reply to author
Forward
0 new messages