Skip to content

Stupid Puppet Trick: Agreeing to the Sun Java License with Debconf Preseeds and Puppet

I had a user ask for Java to be installed on the cluster systems, so I started up by making a simple JRE5 module for puppet, but this first one didn’t quite work:

class jre5 {
  package { "sun-java5-jre":
    ensure => latest;
  }
}

It doesn’t work because Sun wants you to agree to its license before installing the JRE. There’s a couple of ways around this. First, the old-school method:

ssh host "yes | apt-get -y install sun-java5-jre"

where ‘yes’ is a standard Unix program that just prints out “yes” over and over until the program on the other side of the pipe terminates. But “ssh host foo” is not the way of the managed infrastructure.

The second method, much more friendly to centralized management, is to first install debconf-utils on a candidate system, and then install sun-java5-jre on the same system. Once that’s done, you can query the debconf database to see how it stored your answers to the Sun license agreement:

ch226-12:~# debconf-get-selections | grep sun-
sun-java5-bin   shared/accepted-sun-dlj-v1-1    boolean true
sun-java5-jre   shared/accepted-sun-dlj-v1-1    boolean true
sun-java5-jre   sun-java5-jre/jcepolicy note
sun-java5-jre   sun-java5-jre/stopthread        boolean true
sun-java5-bin   shared/error-sun-dlj-v1-1       error
sun-java5-jre   shared/error-sun-dlj-v1-1       error
sun-java5-bin   shared/present-sun-dlj-v1-1     note
sun-java5-jre   shared/present-sun-dlj-v1-1     note

Save those results (debconf seeds) into a file on the gold server. Then we can modify our jre5 class as follows:

class jre5 {
  package { "sun-java5-jre":
    require      => File["/var/cache/debconf/jre5.seeds"],
    responsefile => "/var/cache/debconf/jre5.seeds",
    ensure       => latest;
  }

  file { "/var/cache/debconf/jre5.seeds":
    source => "puppet:///jre5/jre5.seeds",
    ensure => present;
  }
}

Now our class will download the preseeded answers for the Java license, download and install the JRE, and then use the preseeded answers to skip past the license agreement. I had never messed with debconf seeding previously, since I had either just imaged my systems, or provided config files that would be used when I restarted any daemons or programs that depended on those files. Now debconf-utils is part of my standard system class definition.

Note that this method doesn’t work with the default puppet provided in Debian Etch (version 0.20) — the responsefile parameter for Debian packages was only added in puppet 0.22.

{ 6 } Comments

  1. Assignment Help | January 19, 2019 at 5:42 am | Permalink

    The UK professionals at StudentsAssignmentHelp.com present the scholars with the best Assignment Help services at a very good price. Our experts continue giving you quick and speedy assignment delivery as we know they do not have much time to waste. Thus we have a team of passionate and dedicated experts.

  2. uTorrent Download | January 21, 2019 at 12:34 am | Permalink

    µTorrent or uTorrent is a tool developed by BitTorrent that allows you to share or download torrent files. A torrent file is nothing but a file that preserves metadata to facilitate peer-to-peer file sharing protocol. This protocol refers to as BitTorrent that assists in the distribution of data and files over the internet.

  3. OnlineB2BMarketplace | January 21, 2019 at 6:46 am | Permalink

    The following delivers a likely solution. It is perhaps not ideal but rendering to the marionette certification only the following provider’s support install options rpm, windows, and zypper. In which case the response file limit should be used to stipulate the wanted answers used during the set connection.

  4. electronics assignme | January 21, 2019 at 7:23 am | Permalink

    Enjoyed reading the article above , really explains everything in detail,the article is very interesting and effective.

  5. Quality Assignment | January 23, 2019 at 12:28 am | Permalink

    Pleased to find Stupid Puppet Trick on agreeing to the Sun Java License with Debconf Preseeds and Puppet with example.

  6. Mould Tool Making | January 23, 2019 at 12:51 am | Permalink

    A central pleas court distributed a lawful hindrance to sun microsystems on tossing out most of a initial injunction needful Microsoft to transmit its rival’s form of an translator for the java software design language.

Post a Comment

Your email is never published nor shared. Required fields are marked *