Shi
2011-Apr-12 19:55 UTC
[Puppet Users] How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
Hi there, I am new to Puppet and am writing my first module to manage our cluster. So far, it worked out reasonably well. I can add yum repositories and install packages with Puppet automatically. However, one package requires the use of Sun JDK, not the openjdk coming with CentOS. The only way to do this is to download the jdk-6u24-linux-x64-rpm.bin file and run it. I figure I might be able to use something like package {jdk: source="/mnt/share/jdk-6u24-linux-x64-rpm.bin", ensure => installed; } I guess I could put the file under the shared NFS /mnt/share. But there is no way I can tell puppet to simply run the source as an executable. All the PROVIDER options are for a particular format, such as RPM or DEB. I guess I could run the file once on one machine, and it will extract the rpms. I could then just use the rpms, but that is less than ideal. Also, if I don''t want to pre-mount the NFS share, is there any way to scp the file from the master node? Do I then have to set up ssh without password for the root? Thank you very much. Shi -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jon Jaroker
2011-Apr-13 04:38 UTC
[Puppet Users] Re: How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
I have the same requirement to install Sun JDK, not openJDK. Below is the module I am using. I would be grateful for suggestions on how this install can be done better. Thank you, Jon class java { package {"java-1.6.0-openjdk": ensure => absent, } exec {"java_install": cwd => "/opt", command => "/usr/bin/yes | /opt/share/downloads/java/jdk-6u24- linux-x64.bin", creates => "/opt/jdk1.6.0_24/COPYRIGHT", require => Package["java-1.6.0-openjdk"], } file {"/usr/bin/java": ensure => "/opt/jdk1.6.0_24/bin/java", require => Exec["java_install"], } } On Apr 12, 3:55 pm, Shi <jinzish...@gmail.com> wrote:> Hi there, > > I am new to Puppet and am writing my first module to manage our > cluster. So far, it worked out reasonably well. I can add yum > repositories and install packages with Puppet automatically. > However, one package requires the use of Sun JDK, not the openjdk > coming with CentOS. > The only way to do this is to download the jdk-6u24-linux-x64-rpm.bin > file and run it. > > I figure I might be able to use something like > > package {jdk: > source="/mnt/share/jdk-6u24-linux-x64-rpm.bin", > ensure => installed; > } > > I guess I could put the file under the shared NFS /mnt/share. But > there is no way I can tell puppet to simply run the source as an > executable. All the PROVIDER options are for a particular format, such > as RPM or DEB. I guess I could run the file once on one machine, and > it will extract the rpms. I could then just use the rpms, but that is > less than ideal. > > Also, if I don''t want to pre-mount the NFS share, is there any way to > scp the file from the master node? Do I then have to set up ssh > without password for the root? > > Thank you very much. > Shi-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
jcbollinger
2011-Apr-13 16:27 UTC
[Puppet Users] Re: How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
On Apr 12, 11:38 pm, Jon Jaroker <goo...@jaroker.com> wrote:> I have the same requirement to install Sun JDK, not openJDK. Below is > the module I am using. I would be grateful for suggestions on how > this install can be done better.How about manually using the Sun installer to create the RPM, then sticking that RPM in a local repository from which it can be installed via Puppet as an ordinary Package? John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Blazer40
2011-Apr-13 16:35 UTC
[Puppet Users] Re: How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
This is what I did.. I don''t mind the extra step of exploding Oracle''s package as in our env the java version doesn''t change often. I suppose you could script this up though on the repo server side of things.. -Matt On Apr 13, 12:27 pm, jcbollinger <John.Bollin...@stJude.org> wrote:> On Apr 12, 11:38 pm, Jon Jaroker <goo...@jaroker.com> wrote: > > > I have the same requirement to install Sun JDK, not openJDK. Below is > > the module I am using. I would be grateful for suggestions on how > > this install can be done better. > > How about manually using the Sun installer to create the RPM, then > sticking that RPM in a local repository from which it can be installed > via Puppet as an ordinary Package? > > John-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Shi
2011-Apr-13 19:53 UTC
[Puppet Users] Re: How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
Thank Jon. Based on your class, I''ve come up with the following code which worked for me. class sun-jdk { package {"java-1.6.0-openjdk": ensure => absent, } exec {"jdk_install": cwd => "/root", command => "/root/jdk-6u24-linux-x64-rpm.bin", creates => "/usr/java/jdk1.6.0_24/bin/javac", require => [Package["java-1.6.0-openjdk"], file["/root/ jdk-6u24-linux-x64-rpm.bin"]], } package {jdk: require => Exec["jdk_install"], } file {"/root/jdk-6u24-linux-x64-rpm.bin": ensure => present, source => "puppet:///modules/sun-jdk/jdk-6u24-linux-x64- rpm.bin"; } } I didn''t use NFS share but made use of the puppet file server. If anyone has suggestions for improvement, please let me know. Thanks a lot. Shi On Apr 12, 10:38 pm, Jon Jaroker <goo...@jaroker.com> wrote:> I have the same requirement to install Sun JDK, not openJDK. Below is > the module I am using. I would be grateful for suggestions on how > this install can be done better. > > Thank you, > Jon > > class java { > > package {"java-1.6.0-openjdk": > ensure => absent, > } > > exec {"java_install": > cwd => "/opt", > command => "/usr/bin/yes | /opt/share/downloads/java/jdk-6u24- > linux-x64.bin", > creates => "/opt/jdk1.6.0_24/COPYRIGHT", > require => Package["java-1.6.0-openjdk"], > } > > file {"/usr/bin/java": > ensure => "/opt/jdk1.6.0_24/bin/java", > require => Exec["java_install"], > } > > } > > On Apr 12, 3:55 pm, Shi <jinzish...@gmail.com> wrote: > > > > > > > > > Hi there, > > > I am new to Puppet and am writing my first module to manage our > > cluster. So far, it worked out reasonably well. I can add yum > > repositories and install packages with Puppet automatically. > > However, one package requires the use of Sun JDK, not the openjdk > > coming with CentOS. > > The only way to do this is to download the jdk-6u24-linux-x64-rpm.bin > > file and run it. > > > I figure I might be able to use something like > > > package {jdk: > > source="/mnt/share/jdk-6u24-linux-x64-rpm.bin", > > ensure => installed; > > } > > > I guess I could put the file under the shared NFS /mnt/share. But > > there is no way I can tell puppet to simply run the source as an > > executable. All the PROVIDER options are for a particular format, such > > as RPM or DEB. I guess I could run the file once on one machine, and > > it will extract the rpms. I could then just use the rpms, but that is > > less than ideal. > > > Also, if I don''t want to pre-mount the NFS share, is there any way to > > scp the file from the master node? Do I then have to set up ssh > > without password for the root? > > > Thank you very much. > > Shi-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Steven Acres
2011-Apr-14 02:31 UTC
Re: [Puppet Users] Re: How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
On Wed, Apr 13, 2011 at 3:53 PM, Shi <jinzishuai@gmail.com> wrote:> Thank Jon. > Based on your class, I''ve come up with the following code which worked > for me. > class sun-jdk { > package {"java-1.6.0-openjdk": > ensure => absent, > } > exec {"jdk_install": > cwd => "/root", > command => "/root/jdk-6u24-linux-x64-rpm.bin", > creates => "/usr/java/jdk1.6.0_24/bin/javac", > require => [Package["java-1.6.0-openjdk"], file["/root/ > jdk-6u24-linux-x64-rpm.bin"]], > } > package {jdk: > require => Exec["jdk_install"], > } > file {"/root/jdk-6u24-linux-x64-rpm.bin": > ensure => present, > source => "puppet:///modules/sun-jdk/jdk-6u24-linux-x64- > rpm.bin"; > } > } > I didn''t use NFS share but made use of the puppet file server. > > If anyone has suggestions for improvement, please let me know. > Thanks a lot. > Shi > > On Apr 12, 10:38 pm, Jon Jaroker <goo...@jaroker.com> wrote: > > I have the same requirement to install Sun JDK, not openJDK. Below is > > the module I am using. I would be grateful for suggestions on how > > this install can be done better. > > > > Thank you, > > Jon > > > > class java { > > > > package {"java-1.6.0-openjdk": > > ensure => absent, > > } > > > > exec {"java_install": > > cwd => "/opt", > > command => "/usr/bin/yes | /opt/share/downloads/java/jdk-6u24- > > linux-x64.bin", > > creates => "/opt/jdk1.6.0_24/COPYRIGHT", > > require => Package["java-1.6.0-openjdk"], > > } > > > > file {"/usr/bin/java": > > ensure => "/opt/jdk1.6.0_24/bin/java", > > require => Exec["java_install"], > > } > > > > } > > > > On Apr 12, 3:55 pm, Shi <jinzish...@gmail.com> wrote: > > > > > > > > > > > > > > > > > Hi there, > > > > > I am new to Puppet and am writing my first module to manage our > > > cluster. So far, it worked out reasonably well. I can add yum > > > repositories and install packages with Puppet automatically. > > > However, one package requires the use of Sun JDK, not the openjdk > > > coming with CentOS. > > > The only way to do this is to download the jdk-6u24-linux-x64-rpm.bin > > > file and run it. > > > > > I figure I might be able to use something like > > > > > package {jdk: > > > source="/mnt/share/jdk-6u24-linux-x64-rpm.bin", > > > ensure => installed; > > > } > > > > > I guess I could put the file under the shared NFS /mnt/share. But > > > there is no way I can tell puppet to simply run the source as an > > > executable. All the PROVIDER options are for a particular format, such > > > as RPM or DEB. I guess I could run the file once on one machine, and > > > it will extract the rpms. I could then just use the rpms, but that is > > > less than ideal. > > > > > Also, if I don''t want to pre-mount the NFS share, is there any way to > > > scp the file from the master node? Do I then have to set up ssh > > > without password for the root? > > > > > Thank you very much. > > > Shi > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >Hi, Having been down this road with java and various other packages I''d suggest managing the package at the pkg. manager/mirror level (i.e. custom pkg) and _then_ pull from that with java-ensure class as required (also consider utilizing alternatives command for the system implementation. Of course ''./jdk-6u21-linux-x64-rpm.bin -x '' will extract the RPM ... -- Cheers, Steven ----------------------- Steven Acres UNIX/Linux System Administrator -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Bill Weiss
2011-Apr-23 04:28 UTC
Re: [Puppet Users] How to use Puppet to ensure the Sun JDK is installed on CentOS-5.5
On 2011/4/12 2:55 PM, "Shi" <jinzishuai@gmail.com> wrote:>Hi there, > >I am new to Puppet and am writing my first module to manage our >cluster. So far, it worked out reasonably well. I can add yum >repositories and install packages with Puppet automatically. >However, one package requires the use of Sun JDK, not the openjdk >coming with CentOS. >The only way to do this is to download the jdk-6u24-linux-x64-rpm.bin >file and run it. > >I figure I might be able to use something like > >package {jdk: > source="/mnt/share/jdk-6u24-linux-x64-rpm.bin", > ensure => installed; > } > >I guess I could put the file under the shared NFS /mnt/share. But >there is no way I can tell puppet to simply run the source as an >executable. All the PROVIDER options are for a particular format, such >as RPM or DEB. I guess I could run the file once on one machine, and >it will extract the rpms. I could then just use the rpms, but that is >less than ideal. > >Also, if I don''t want to pre-mount the NFS share, is there any way to >scp the file from the master node? Do I then have to set up ssh >without password for the root?It''s easier than you think! :) If you run that .bin with -x on the command line, it will extract an RPM for you to use. I do that once per new JDK and put it in our local yum repository. -- Bill Weiss Backstop Solutions Group -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.