On Tue, Jul 6, 2010 at 1:15 AM, Peter Meier <peter.me...@immerda.ch> wrote:
> Hi
>
>> I googled for this thoroughly but couldn't find any module that
>> actually worked.
>>
>> Is there any good puppet module or manifest for installing Sun JDK?
>
> we usually re-package SunJDK with jpackage and put it in our own repo,
> then it is simply a matter of package installation. this makes also
> updating etc. a lot easier.
>
> cheers pete

The following works for Ubuntu 10.04 clients. One note though is that
this doesn't account for the fact that after adding the partners
repository `apt-get update` needs to be run or apt won't know anything
about the sun-java packages. I imagine that could probably be
automated with an refreshonly exec resource if needed. Offhand I can't
remember where I originally got it. A forum, somewhere.

No idea if this helps or not; I don't believe you've mentioned what
kind of systems you need this for. :-)

~Reid

----- BEGIN -----

class ubuntu::sunjava {

  Exec {
    path => [ '/bin', '/usr/bin' ],
  }

  exec {
    "debconf-set-selections-sun-java6-bin":
      command => "echo 'sun-java6-bin shared/accepted-sun-dlj-v1-1
boolean true' | debconf-set-selections",
      unless  => "debconf-get-selections | egrep
'^sun-java6-bin[[:space:]]+shared/accepted-sun-dlj-v1-1[[:space:]]+boolean[[:space:]]+true$'";
    "debconf-set-selections-sun-java6-jdk":
      command => "echo 'sun-java6-jdk shared/accepted-sun-dlj-v1-1
boolean true' | debconf-set-selections",
      unless  => "debconf-get-selections | egrep
'^sun-java6-jdk[[:space:]]+shared/accepted-sun-dlj-v1-1[[:space:]]+boolean[[:space:]]+true$'";
    "debconf-set-selections-sun-java6-jre":
      command => "echo 'sun-java6-jre shared/accepted-sun-dlj-v1-1
boolean true' | debconf-set-selections",
      unless  => "debconf-get-selections | egrep
'^sun-java6-jre[[:space:]]+shared/accepted-sun-dlj-v1-1[[:space:]]+boolean[[:space:]]+true$'";
  }

  package {
    "sun-java6-jre":
      ensure  => installed,
      require => [ Exec["debconf-set-selections-sun-java6-jre"],
                   File["/etc/apt/sources.list.d/partner.list"],
                 ];
    "sun-java6-jdk":
      ensure  => installed,
      require => [ Exec["debconf-set-selections-sun-java6-jdk"],
                   File["/etc/apt/sources.list.d/partner.list"],
                 ];
  }

  file {
    "/etc/apt/sources.list.d/partner.list":
      ensure  => file,
      source  => "puppet:///ubuntu/etc/apt/sources.list.d/partner.list",
      owner   => "root",
      group   => "root";
  }

}

----- END -----

----- /etc/apt/sources.list.d/partner.list -----
# Ubuntu partner repository
deb http://archive.canonical.com/ lucid partner
----- END -----

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to