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. aptoide ios 13 | May 13, 2019 at 8:27 am | Permalink

    Thank you very much.

  2. Homeofgamers.in | May 13, 2019 at 10:13 pm | Permalink

    Hey Thanks for sharing this valuable information with us. I will come back to your site and keep sharing this information with us
    Check it out
    Check it out

  3. Gclub | May 14, 2019 at 3:53 am | Permalink

    This is really good blog information thanks for sharing .I am really impressed with your writing abilities

  4. Fmovies | May 14, 2019 at 1:30 pm | Permalink

    Hi there, so thanks for your article, it really usefull and helpfull for me. I have found this information at everywhere i can but the result is nothing. But when i read your article, is the only one brought me these information clearly and most exactly. I just want to encourage you: Keep doing this and write more articles like this in future. Thank you so much.

  5. Ielts Coaching in Dw | May 15, 2019 at 1:24 am | Permalink

    Best IELTS Prepartion Centre in Dwarka

  6. Office.com/setup | May 15, 2019 at 3:45 am | Permalink

    Very nice blog and articles. I am really very happy to visit your blog. Now I am found which I actually want. I check your blog every day and try to learn
    something from your blog. Thank you and waiting for your new post.

  7. Office.com/setup | May 15, 2019 at 3:46 am | Permalink

    Very nice blog and articles. I am really very happy to visit your blog. Now I am found which I actually want. I check your blog every day and try to learn something from your blog. Thank you and waiting for your new post.

  8. cartoon-hd-apk | May 15, 2019 at 8:18 am | Permalink

    The very next time I read a blog, I hope that it does not disappoint me as much as this particular one. I mean, I know it was my choice to read, but I truly thought you would probably have something useful to say. All I hear is a bunch of crying about something that you could possibly fix if you were not too busy searching for attention.

  9. Techrabytes | May 15, 2019 at 9:41 am | Permalink

    Well siad.

  10. https://prime-essay. | May 20, 2019 at 4:37 am | Permalink

    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. If you need help with your essays, visit our website.

Post a Comment

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