aboutsummaryrefslogtreecommitdiff
path: root/manifests/utils/java.pp
blob: 09a79a65e470279cb81471b96945eaba05f6ac2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class nodo::utils::java (
  $ensure = 'installed',
) {
  # Java
  package { [
    'sun-java6-jre',
  ]:
    ensure => absent,
  }

  package { [
    'default-jre',
    'openjdk-7-jre-headless',
  ]:
    ensure => $ensure,
  }

  # Java alternative
  file { "/etc/alternatives/java":
    ensure  => $ensure ? {
      'present','installed','latest' => lookup('nodo::utils::java::alternative', undef, undef, '/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java'),
      default                        => undef,
    },
    owner   => root,
    group   => root,
    require => Package['default-jre'],
  }
}