aboutsummaryrefslogtreecommitdiff
path: root/manifests/utils/java.pp
blob: 59e26a3fc2540c91cae722b59f110f0162d91e1f (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' => hiera('nodo::utils::java::alternative', '/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java'),
      default                        => undef,
    },
    owner   => root,
    group   => root,
    require => Package['default-jre'],
  }
}