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.

{ 10 } Comments

  1. ManagementHomework | May 29, 2018 at 7:13 am | Permalink

    Thanks for sharing.This blog is very useful.

  2. UK Dissertation Help | May 31, 2018 at 2:13 am | Permalink

    The few points discover in new criteria so this tutorials help lot in that perspective management, is to first install the sun-java-utils through manage the system configuration and then install sun-java5.

  3. CDR Report Help | June 1, 2018 at 1:18 am | Permalink

    Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for this long time. We also provide blog CDR Report Help Australia.

  4. CDR Report Help | June 1, 2018 at 1:22 am | Permalink

    I really happy found this website eventually. Really informative and inspirative,Thanks for the post and effort ! Please keep sharing more such blog. I have really like your blog and inspire me in many ways, We have already set a high standard for CDR Report Help Australia.

  5. Royal Car Rentals | June 1, 2018 at 2:34 am | Permalink

    The few focuses find in new criteria so this instructional exercises help parcel in that point of view administration, is to first introduce the sun-java-utils through deal with the framework design and afterward introduce sun-java5.

  6. Do my assignment | June 5, 2018 at 3:31 am | Permalink

    Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for this long time.

  7. home plans | June 5, 2018 at 6:10 am | Permalink

    For a long time i had searched this topic in many blogging sites. I hadn’t got this. Fortunately now i got it from here. Thanks

  8. Assignment help | June 8, 2018 at 1:37 am | Permalink

    Allassignmenthelp is a web portal where students get help in making assignments for all the subjects, with the help of our experts. You will get 100% plagiarism free assignment. Expert’s consultation is also available for students. If they have any query they can contact with our experts anytime.

  9. sonu | June 11, 2018 at 5:57 am | Permalink

    This is really good for the everyone

  10. maslak oto ekspertiz | June 11, 2018 at 2:34 pm | Permalink

    Thank you very much for sharing this very useful information, I am very happy to have found this information that I have been looking for this long time.

Post a Comment

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