Puppet Class: ojdk7

Defined in:
manifests/init.pp

Overview

Parameters:

  • jAVA_HOME (Any) (defaults to: 'UNSET')
  • sourcePath (Any) (defaults to: 'puppet://master.sapient.com/modules/ojdk7')
  • user (Any) (defaults to: 'puppet')
  • group (Any) (defaults to: 'puppet')
  • type (Any) (defaults to: 'x64')


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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'manifests/init.pp', line 1

class ojdk7(
  $jAVA_HOME            = 'UNSET',
  $sourcePath           = 'puppet://master.sapient.com/modules/ojdk7',
  $user                 = 'puppet',
  $group                = 'puppet',
  $type                 = 'x64'
){
  user { "${user}" :
      ensure    =>  present
      }
  group { "${group}" :
      ensure    =>  present
      }

  case $::osfamily{
    'RedHat': {
      $installExtension   = 'rpm'
      $installerLocation  = "/opt/jdk-7u71-linux-${type}.${installExtension}"
      file { "${installerLocation}" :
        source  =>  "${sourcePath}/jdk-7u71-linux-${type}.${installExtension}",
        ensure  =>  "present",
        replace =>  false,
        mode    =>  '0755',
        owner   =>  $user
      }
      
    }
    'CentOS': {
      $installExtension = 'rpm'
      $installerLocation  = "/opt/jdk-7u71-linux-${type}.${installExtension}"
      file { "${installerLocation}" :
        source  =>  "${sourcePath}/jdk-7u71-linux-${type}.${installExtension}",
        ensure  =>  "present",
        replace =>  false,
        mode    =>  '0755',
        owner   =>  $user    
      }
      
      
    }
    'OracleLinux':{
      $installExtension = 'rpm'
      $installerLocation  = "/opt/jdk-7u71-linux-${type}.${installExtension}"
      file { "${installerLocation}" :
        source  =>  "${sourcePath}/jdk-7u71-linux-${type}.${installExtension}",
        ensure  =>  "present",
        replace =>  false,
        mode    =>  '0755',
        owner   =>  $user
      }
      
     
    }
    'debian':{
      $installExtension = 'tar.gz'
      $installerLocation  = "/opt/jdk-7u71-linux-${type}.${installExtension}"     
      file { "${installerLocation}" :
        source  =>  "${sourcePath}/jdk-7u71-linux-${type}.${installExtension}",
        ensure  =>  "present",
        replace =>  false,
        mode    =>  '0755',
        owner   =>  $user
        }      
    }
    'windows':{
      
      $installExtension   = 'exe'
      $installerLocation  = "C:/Users/puppet/jdk-7u71-windows-${type}.${installExtension}"
      
      file { "${installerLocation}" :
        source  =>  "${sourcePath}/jdk-7u71-windows-${type}.${installExtension}",
        ensure  =>  "present",
        replace =>  false,
        owner   =>  $user
        }
      
    }
    'default':{
      fail("Unrecognized operating system ${::kernel}, please use it on a debian/redhat/oraclelinux/windows 64bit host")
    }
  }
  class { "ojdk7::install": }
}