Sun wants you to agree to its license before installing the JRE/JDK. For an unattended install you need a preseed file.
You get the content of this file with „debconf-get-selections | grep sun-„ on a system where you have already installed the required packages.
Create a file „/etc/puppet/files/sun-java6.preseed“ with the following example content:
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
I use this APT-Module to add the Ubuntu partner repository. (Required for Sun-Packages)
apt::source { "partner": location => "http://archive.canonical.com/ubuntu", release => "${lsbdistcodename}", repos => "partner", include_src => false, }
Now you can install the sun package:
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"] ], }
Note: I use sun-java6-jdk but you can install sun-java5-jre in the same way.
Matt
3 Okt 2011This saved me so much time. Thank you!
larry
9 Okt 2011probably „source => „puppet://$server/filesserver/sun-java6.preseed“ should be „source => „puppet://$server/files/sun-java6.preseed“,
sebastian
9 Okt 2011This 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
16 Okt 2011Ok, 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.