Sebastian Mogilowskis Blog

Just another blog about administration, linux and other stuff

Language: German English

Install Sun Java with Puppet on Ubuntu

Bei der Installation von Softwarepaketen (JRE oder JDK) von Sun muss man den Lizenzbestimmungen zustimmen. Für eine automatische Installation benötigt man daher eine Preseed-Datei.
Den Inhalt dieser Datei bekommt man mit “debconf-get-selections | grep sun-” auf einem System auf dem man bereits die Installation durchgeführt hat.

Nun legt man eine Datei “/etc/puppet/files/sun-java6.preseed” mit dem folgenden Beispielinhalt an:

sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jdk shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true
sun-java6-jre sun-java6-jre/stopthread boolean true
sun-java6-jre sun-java6-jre/jcepolicy note
sun-java6-bin shared/error-sun-dlj-v1-1 error
sun-java6-jdk shared/error-sun-dlj-v1-1 error
sun-java6-jre shared/error-sun-dlj-v1-1 error
sun-java6-bin shared/present-sun-dlj-v1-1 note
sun-java6-jdk shared/present-sun-dlj-v1-1 note
sun-java6-jre shared/present-sun-dlj-v1-1 note

Ich habe dieses APT-Modul verwendet, um das Ubuntu Partner Repository zu installieren. Dieses wird für die Sun-Pakete benötigt.

apt::source { "partner":
    location => "http://archive.canonical.com/ubuntu",
    release => "${lsbdistcodename}",
    repos => "partner",
    include_src => false,
}

Nun kann man die Pakete installieren:

file { "/var/cache/debconf/sun-java6.preseed":
    source => "puppet://$server/filesserver/sun-java6.preseed",
    ensure => present
}
package { "sun-java6-jdk":
    ensure  => installed,
    responsefile => "/var/cache/debconf/sun-java6.preseed",
    require => [ Apt::Source["partner"], File["/var/cache/debconf/sun-java6.preseed"] ],
}

Bemerkung: Ich habe hier sun-java6-jdk installiert. sun-java5-jre lässt sich jedoch ebenso installieren.

, , ,

4 Responses to “Install Sun Java with Puppet on Ubuntu”

  • Matt says:

    This saved me so much time. Thank you!

  • larry says:

    probably “source => “puppet://$server/filesserver/sun-java6.preseed” should be “source => “puppet://$server/files/sun-java6.preseed”,

    • sebastian says:

      This depends on your specific configuration.

      files if you use this in a module and fileserver if you use the global fileserver path. (/etc/puppet/files/)

      And check “/etc/puppet/fileserver.conf”

      [fileserver]
      path /etc/puppet/files

      • larry says:

        Ok, I just notice default is it [files] instead of [fileserver] in my ubuntu (puppet 2.6.4).

        And probably it is fileserver instead of filesserver.

        Anyway, very nice article, useful for me.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

eMail-Benachrichtigung bei weiteren Kommentaren.
Auch möglich: Abo ohne Kommentar.