puppetlabs-java: installing oracle-jdk on ubuntu trusty 14.04

1,443 views
Skip to first unread message

Milan Simonović

unread,
Jun 6, 2014, 4:17:20 PM6/6/14
to puppet...@googlegroups.com
Hi,

puppet 3.6.1 on a vanilla trusty ubuntu server, trying to install oracle-jdk:

  class { 'java':

    distribution => 'oracle-jdk',

    version      => 'latest',

  }


exits with the following error:


Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install oracle-j2sdk1.7' returned 100: Reading package lists...

Building dependency tree...

Reading state information...

E: Unable to locate package oracle-j2sdk1.7

E: Couldn't find any package by regex 'oracle-j2sdk1.7'


am I missing a source or what (puppetlabs.list is in /etc/apt/sources.list.d/)?

thanks,
Milan

Николай Колев

unread,
Jun 7, 2014, 5:15:40 AM6/7/14
to puppet...@googlegroups.com
Hi Milan,

In order to install oracle java you have to add third party repository,
How you can do this you can do it read this article: http://www.webupd8.org/2012/01/install-oracle-java-jdk-7-in-ubuntu-via.html
If you want this to be part of the puppet catalog use puppetlabs-apt module to add it to the sources list

best regards,
Nickolay Kolev

Milan Simonović

unread,
Jun 7, 2014, 7:19:09 AM6/7/14
to puppet...@googlegroups.com
Николай thanks for the tip. Sorry I forgot to mention that ppa:webupd8team/java had been added already, 
but still it doesn't work, there's no oracle-j2sdk1.7 deb package there. 

best,
Milan

Николай Колев

unread,
Jun 7, 2014, 10:32:29 AM6/7/14
to puppet...@googlegroups.com
Hi Milan,

the name of the package is oracle-java7-installer
what deb package does is to download java archive from Oracle;s web site and then unpacks it and then some postinstall work like regsitering in alternatives and setting JAVA_HOME etc.
Hope this helps.

best regards,
Nickoaly Kolev

Milan Simonović

unread,
Jun 7, 2014, 11:26:46 AM6/7/14
to puppet...@googlegroups.com
maybe I wasn't clear. I know how to install java by hand from ppa:webupd8team/java. What I want is to have puppetlabs-java install it, and it fails. Adding ppa:webupd8team/java repo doesn't help. Has anyone managed to install 'oracle-jdk' using puppetlabs-java on ubuntu?

best,
Milan

Николай Колев

unread,
Jun 9, 2014, 8:49:09 AM6/9/14
to puppet...@googlegroups.com
last try
probably my english is not so good

this is the module that I use to install oracle java (it is part of larger more complex setup so I post only this part)

#provides installation of oracle java for linux
class java_oracle::linux{
  include java_oracle

  $java_version  = $java_oracle::java_version

  if ($java_version == undef) {
    fail('java_version is required')
  }

  exec {'echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections':
    path => ['/bin', '/usr/bin']
  }
  ->
  exec {'echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections':
    path => ['/bin', '/usr/bin']
  }
  ->
  package { 'oracle-java7-installer':
    ensure => $java_version

Milan Simonović

unread,
Jun 10, 2014, 1:35:24 AM6/10/14
to puppet...@googlegroups.com
:) thanks, but I know how to write a class that installs java from ppa:webupd8team/java, that's not what i was asking. I'm still trying to figure out how to install java just using puppetlabs-java module.

Dirk Heinrichs

unread,
Jun 10, 2014, 2:11:55 AM6/10/14
to puppet...@googlegroups.com
Am 10.06.2014 07:35, schrieb Milan Simonović:
I'm still trying to figure out how to install java just using puppetlabs-java module.

You can't. There is no package "oracle-jdk" on Ubuntu.

Bye...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Milan Simonović

unread,
Jun 13, 2014, 5:21:01 PM6/13/14
to puppet...@googlegroups.com, d...@recommind.com
Hi Dirk,

thank you for confirming. Guess I should submit a but to puppetlabs-java.. 

Anyway, here's a simple class that installs it from ppa:webupd8team:

class java {

  $package = 'oracle-java7-installer'


  file { '/tmp/java.preseed':

    content => 'oracle-java7-installer shared/accepted-oracle-license-v1-1 select true                                 

oracle-java7-installer shared/accepted-oracle-license-v1-1 seen true',

    mode   => '0600',

    backup => false,

  }


  include apt

  apt::ppa { 'ppa:webupd8team/java': }

  package { "$package":

    responsefile => '/tmp/java.preseed',

    require      => [

                     Apt::Ppa['ppa:webupd8team/java'],

                     File['/tmp/java.preseed']

                     ],

Reply all
Reply to author
Forward
0 new messages