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.

{ 48 } Comments

  1. Robin | April 7, 2009 at 1:46 am | Permalink

    When I ran debconf-get-selections, the various ‘accepted’ fields had the value ‘select true’. This still causes you to be asked (or, if using puppet, the install to fail.) So this is a note to anyone else finding this: make sure that they are ‘boolean true’ as they are in this post. It turns out to be something that takes about 45 minutes of staring to work out :)

  2. Robin | April 7, 2009 at 3:22 am | Permalink

    Additionally, there must not be more than a single space between ‘boolean’ and ‘true’ or you may spend a very long time figuring it out again.

    Even if that’s what debconf-get-selections provides in your case.

  3. Mike Renfro | April 7, 2009 at 8:54 am | Permalink

    Odd. I don’t recall editing anything in the debconf output; it may have changed with the Lenny release? Might be something else entirely, too.

  4. Soren Vind | January 28, 2010 at 5:18 am | Permalink

    Thank you SO much for this! Have been looking around for a while for a good solution to that problem. It is quite painful to accept the license agreement manually on tens of servers :)

  5. Jan | May 12, 2010 at 7:47 am | Permalink

    Thank you. Also: I run Lenny on my machines and I didn’t have to edit the debconf-get-selections output.

  6. Peter Sankauskas | December 9, 2010 at 9:13 pm | Permalink

    This is awesome! Thank you very much. If I get time, I will repost this on my blog updated for Ubuntu 10.04, Puppet 0.25 and JDK6

  7. Offirmo | November 2, 2011 at 4:45 pm | Permalink

    Excellent ! Just what I was looking for ! I didn’t even know this preseeding technique.
    Successfully applied this pre-seeding technique for java6 / ubuntu 10.04.
    Très bien !

  8. professional house | July 11, 2018 at 11:19 am | Permalink

    Much thanks to you. Additionally: I run Lenny on my machines and I didn’t need to alter the debconf-get-choices yield.

  9. Hotmail Login | July 17, 2018 at 9:40 am | Permalink

    Thank you for posting such a great article! I found your website perfect for my needs. It contains wonderful and helpful posts. Keep up the good work!. Thank you for this wonderful Article!

  10. Login | July 17, 2018 at 9:42 am | Permalink

    Posts are very meaningful thanks to the site

  11. Hotmail Login Tip | July 17, 2018 at 9:45 am | Permalink

    Excellent post. This article is very helpful for the people and also for me. I get the some useful knowledge in this post. Thanks for sharing the informative topic, by the way

  12. Human Rights Topics | July 20, 2018 at 6:14 am | Permalink

    Every day we are provide you a custom made assignment with proper referencing. So to get qualitative human rights topics for research paper don’t need to else just visit at Students Assignment Help.

  13. Swipeapp | July 29, 2018 at 9:51 am | Permalink

    Thanks, that was helpful.

  14. Programming Homework | July 31, 2018 at 9:24 am | Permalink

    In the domain of computer science, programming is one such field that is highly important. If you wish to have expertise in programming and want 100% accurate solutions then you must grab programming homework help from The professionals are having years of experience in programming and thus you can expect tailor-made solutions which will meet your expectation levels.

  15. Assignment Help | August 6, 2018 at 12:37 am | Permalink

    Many students face the problem of stress in college. Whether it is because of social anxiety, or not being able to clear exam etc. Most of the times, students get stressed due to their piled up assignments. If it is with you also then you might seek for Assignment Help.

  16. | August 6, 2018 at 4:29 am | Permalink

    This is where you might have started your search for assignment help.The previous consumers give their feedback on the website to let the other users know about the quality of their service. For example, if you go to the allassignmenthelp Reviews, you can get to know the opinion of different users about their services. You can also check other websites to compare and select the best service for you.

  17. AAdil | August 21, 2018 at 10:00 am | Permalink

    Wow! Great content

  18. AAdil | August 21, 2018 at 10:00 am | Permalink

    Wow! Great content, Keep it up

  19. Best Editing Service | August 28, 2018 at 3:14 pm | Permalink

    Hi, your blog is truly faultless and unique. Very wonderful your article, This is best article. I read really perfect your article more information one of other blog zone. So I like it. Thank so much for sharing this article with us.

  20. Mobile App News | August 29, 2018 at 8:34 am | Permalink

    Good news. Appreciate this post. Thank you for compiling and sharing it.

  21. Essay help UK | September 1, 2018 at 4:12 am | Permalink

    When I ran debconf-get-choices, the different ‘acknowledged’ fields had the esteem ‘select genuine’. This still makes you be asked (or, if utilizing manikin, the introduction to flop.) So this is a note to any other individual discovering this: ensure they are ‘boolean valid’ as they are in this post. It ends up being something that takes around a few minutes of gazing to work out.

  22. Essay help UK | September 1, 2018 at 4:15 am | Permalink

    You have explained the post very well, each and every step is clarify to it’s best, hope to see this sort of informative post from you soon.

  23. ariana johnson | September 3, 2018 at 9:44 am | Permalink

    I like your working style. Your blog is so interesting and informative. You have done a superb job. Thanks for sharing this info with us

  24. Steve Jackson | September 10, 2018 at 9:38 am | Permalink

    Very well explained! Good work

  25. Assignment Help | September 11, 2018 at 4:11 am | Permalink

    Hello there, your blog is genuinely impeccable and exceptional. Exceptionally magnificent your article, This is best article. I read extremely culminate your article more data one of other blog zone. So I like it. Thank such a great amount for offering this article to us.

  26. Best Anti Adware Too | September 11, 2018 at 8:13 am | Permalink

    Hey Admin,
    I was going through your article and I must say you have a very great writing skills.
    The way you have elaborated every point is just amazing.
    Also I guess you have done a good amount of research on this topic.
    Btw I am also a writer and has written an article.

  27. | September 13, 2018 at 4:42 pm | Permalink

    would love to read this and very helpful to many others. I really liked this stuff. Thank you

  28. | September 14, 2018 at 2:59 pm | Permalink

    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”

    path /etc/puppet/files

  29. Mobdro Apk | September 18, 2018 at 2:23 am | Permalink

    Mobdro is free video streaming applications that enable you to watch your favorite videos, movies, daily TV shows and many others including multiples of TV channels.

  30. | September 27, 2018 at 5:26 pm | Permalink

    MegaBox HD is another movies android app which is very like Showbox. However, this app is accessible for Android clients as it were.

  31. routing numbers | October 5, 2018 at 11:36 am | Permalink

    A Bank ABA “routing numbers” or “check routing number” (ABA) is a 9 digit code used in the United States to ID the institution from which money is drawn.

  32. ArleneBMorgan | October 11, 2018 at 3:12 am | Permalink

    24x7homeworkhelp best academic Solutions our students. We Provide Biology, Chemistry, Civil Engineering, Computer Science etc Home Work help.Our team of topmost academic experts makes our students homework service more reliable by preparing help manuals according to the current requirements of educational institutions. Also, we have 24x7x365 free online chat facility!

  33. programming homework | October 12, 2018 at 5:45 am | Permalink

    Get yourself customized programming homework help below 15$ that include Java assignment aid, php homework solutions and many more.

  34. programming homework | October 12, 2018 at 5:46 am | Permalink

    Get yourself customized programming homework help below 15 that include Java assignment aid, php homework solutions and many more.

  35. Help With Programmin | October 19, 2018 at 1:46 am | Permalink

    Hi Buddy, Your Blog’ S Design Is Simple And Clean And I Like It. Your Blog Posts About Online Dissertation Help Are Superb. Please Keep Them Coming. Greets!!

  36. Assignment Help | October 25, 2018 at 12:29 am | Permalink

    Myassignment Help is a well-established and prominent name in providing high-quality assignment help online to students for almost a decade. You can trust our academic ghostwriters completely to get best quality write-ups including case studies, research proposals, dissertations and theses, and more. It is the best assignment help Adelaide provider. Students should always keep themselves ready to meet the university requirements in order to achieve good grades, moreover, they prefer attending lengthy classes instead of writing assignments.

  37. Assignment Help | October 25, 2018 at 12:29 am | Permalink

    Very nice blog. It was nice reading it. Thank you for sharing such an informative blog with us.

  38. hotmail email login | October 26, 2018 at 5:36 am | Permalink

    Heya just wanted to give you a brief heads up and let you know a few of the pictures aren’t loading properly. I’m not sure why but I think its a linking issue.

  39. convert youtube to w | October 27, 2018 at 5:00 am | Permalink

    A debt of gratitude is in order for posting this data. I simply need to tell you that I simply look at your site and I discover it exceptionally fascinating and enlightening.

  40. happy wheels | October 28, 2018 at 10:12 pm | Permalink

    On the hills and far away. One million miles from L.A. We will find the beginning of something new. Take me anywhere, take me anywhere. Wherever you go with you. Just have you and the game: basketball legends game

  41. ankush | October 30, 2018 at 11:03 am | Permalink

    Awesome post kahoot teacher login

  42. ankush | October 30, 2018 at 11:05 am | Permalink

    Awesome post kahoot teacher login

  43. Online Assignment He | October 31, 2018 at 1:08 am | Permalink

    I figure this article is the best article on this point I have found till date.
    Author has demonstrated incredible aptitudes in composing this article and has secured every one of the focuses.
    Every one of the focuses are portrayed in the most ideal way.

  44. Dental Clinic In Jai | October 31, 2018 at 1:09 am | Permalink

    A debt of gratitude is in order for sharing such an astounding post with us it is exceptionally educational and supportive. Keep it up..

  45. litebluee | November 1, 2018 at 6:15 am | Permalink

    lite blueeFor information, USPS mainly stands for United States Postal Service where thousands of employees are pouring their contribution towards improving the nation.

  46. govardhan puja vidhi | November 3, 2018 at 3:14 am | Permalink

    Govardhana Puja. The day after Diwali is called Annakuta, or Govardhana Puja. On this day the …
    Diwali and Govardhan-puja – two widely celebrated …

  47. | November 3, 2018 at 4:06 am | Permalink

    I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.

  48. script satış | November 4, 2018 at 2:35 am | Permalink

    A debt of gratitude is in order for sharing such an astounding post with us it is exceptionally educational and supportive. Keep it up..

{ 2 } Trackbacks

  1. IT-Consulting Hempel | June 25, 2011 at 9:59 am | Permalink

    Ubuntu – Sun Java6 mit Puppet installieren…

    Ich bin gerade dabei die Installation einer Arbeitsstation / Notebooks mittels Puppet zu automatisieren. Ziel ist es nach der Installation der Grundversion von Ubuntu 10.10 mittels Puppet die Installation weiter Software sowie die Grundkonfiguration zu…

  2. […] have tried to automate the exim setup via puppet. I followed the approach described here, whiched worked for me for a few packages, but for exim I had a problem: one selection was not […]

Post a Comment

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