Permalink
Browse files

Merge pull request #53 from Edmilson-JR/jrockit_indentation

Correction of files indentation
  • Loading branch information...
2 parents 7471a27 + a1b3c63 commit 15e94ef3ba34c999a9f8faab27a31edd34552bd9 @biemond committed Jun 29, 2016
Showing with 132 additions and 122 deletions.
  1. +75 −72 modules/jrockit/manifests/installrockit.pp
  2. +57 −50 modules/jrockit/manifests/javaexec.pp
@@ -1,86 +1,89 @@
# jrockit::instalrockit
-define jrockit::installrockit(
- $version = undef ,
- $x64 = undef,
- $downloadDir = '/install/',
- $puppetMountDir = undef,
- $installDemos = 'false',
- $installSource = 'false',
- $installJre = 'true',
- $setDefault = 'true',
- $jreInstallDir = '/usr/java',) {
+define jrockit::installrockit (
+ $version = undef,
+ $x64 = undef,
+ $downloadDir = '/install/',
+ $puppetMountDir = undef,
+ $installDemos = false,
+ $installSource = false,
+ $installJre = true,
+ $setDefault = true,
+ $jreInstallDir = '/usr/java',
+ ) {
- $fullVersion = "jrockit-jdk${version}"
- $installDir = "${jreInstallDir}/${fullVersion}"
+ $fullVersion = "jrockit-jdk${version}"
+ $installDir = "${jreInstallDir}/${fullVersion}"
- notify {"installrockit.pp ${title} ${version}":}
+ notify {"installrockit.pp ${title} ${version}":}
- if $x64 == "true" {
- $type = 'x64'
- } else {
- $type = 'ia32'
- }
+ if $x64 == true {
+ $type = 'x64'
+ }
+ else {
+ $type = 'ia32'
+ }
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian: {
- $installVersion = "linux"
- $installExtension = ".bin"
- $user = "root"
- $group = "root"
- }
- windows: {
- $installVersion = "windows"
- $installExtension = ".exe"
- }
- default: {
- fail("Unrecognized operating system")
- }
- }
-
- $jdkfile = "jrockit-jdk$version-${installVersion}-${type}${installExtension}"
+ case $::operatingsystem {
+ CentOS, RedHat, OracleLinux, Ubuntu, Debian: {
+ $installVersion = 'linux'
+ $installExtension = '.bin'
+ $user = 'root'
+ $group = 'root'
+ }
+ windows: {
+ $installVersion = 'windows'
+ $installExtension = '.exe'
+ }
+ default: {
+ fail('Unrecognized operating system')
+ }
+ }
- File {
- replace => false,
- }
+ $jdkfile = "jrockit-jdk${version}-${installVersion}-${type}${installExtension}"
- # check install folder
- if ! defined(File[$downloadDir]) {
- file { $downloadDir :
- mode => 0777,
- path => $downloadDir,
- ensure => directory,
- }
- }
+ File {
+ replace => false,
+ }
- # if a mount was not specified then get the install media from the puppet master
- if $puppetMountDir == undef {
- $mountDir = "puppet:///modules/jrockit/"
- } else {
- $mountDir = $puppetMountDir
+ # check install folder
+ if ! defined(File[$downloadDir]) {
+ file { $downloadDir :
+ ensure => directory,
+ mode => '0777',
+ path => $downloadDir,
}
+ }
+ # if a mount was not specified then get the install media from the puppet master
+ if $puppetMountDir == undef {
+ $mountDir = 'puppet:///modules/jrockit/'
+ }
+ else {
+ $mountDir = $puppetMountDir
+ }
- # download jdk to client
- if ! defined(File["${downloadDir}/${jdkfile}"]) {
- file {"${downloadDir}/${jdkfile}":
- path => "${downloadDir}/${jdkfile}",
- ensure => present,
- source => "${mountDir}${jdkfile}",
- require => File[$downloadDir],
- mode => 0777,
- }
- }
+ # download jdk to client
+ if ! defined(File["${downloadDir}/${jdkfile}"]) {
+ file {"${downloadDir}/${jdkfile}":
+ ensure => present,
+ path => "${downloadDir}/${jdkfile}",
+ source => "${mountDir}${jdkfile}",
+ require => File[$downloadDir],
+ mode => '0777',
+ }
+ }
- # install on client
- javaexec {"jdkexec ${title} ${version}":
- path => $downloadDir,
- fullversion => $fullVersion,
- jdkfile => $jdkfile,
- setDefault => $setDefault,
- user => $user,
- group => $group,
- jreInstallDir => $jreInstallDir,
- require => File["${downloadDir}/${jdkfile}"],
- }
+ # install on client
+ javaexec {"jdkexec ${title} ${version}":
+ path => $downloadDir,
+ fullversion => $fullVersion,
+ version => $version
+ jdkfile => $jdkfile,
+ setDefault => $setDefault,
+ user => $user,
+ group => $group,
+ jreInstallDir => $jreInstallDir,
+ require => File["${downloadDir}/${jdkfile}"],
+ }
}
@@ -1,109 +1,116 @@
-# javaexec
+# javaexec
# run the silent install
# set the default java links
# set this java as default
-define javaexec ($path = undef,
- $fullversion = undef,
- $jdkfile = undef,
- $setDefault = undef,
- $user = undef,
- $jreInstallDir = undef,
- $group = undef,) {
+define jrockit::javaexec (
+ $path = undef,
+ $version = undef,
+ $fullversion = undef,
+ $jdkfile = undef,
+ $setDefault = undef,
+ $user = undef,
+ $jreInstallDir = undef,
+ $group = undef,
+ ) {
# install jdk
- case $operatingsystem {
- CentOS, RedHat, OracleLinux, Ubuntu, Debian: {
-
- $execPath = "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:"
- $javaInstall = "${jreInstallDir}"
+ case $::operatingsystem {
+ CentOS, RedHat, OracleLinux, Ubuntu, Debian: {
+ $execPath = '/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:'
+ $javaInstall = $jreInstallDir
$silentfile = "${path}/silent${version}.xml"
Exec {
logoutput => true,
path => $execPath,
user => $user,
- group => $group,
+ group => $group,
}
# check java install folder
if ! defined(File[$javaInstall]) {
file { $javaInstall :
- path => $javaInstall,
- ensure => directory,
- mode => 0755,
+ ensure => directory,
+ path => $javaInstall,
+ mode => '0755',
}
}
-
+
# Create the silent install xml
file { "silent.xml ${version}":
- path => "${silentfile}",
ensure => present,
+ path => $silentfile,
replace => 'yes',
- content => template("jrockit/jrockit-silent.xml.erb"),
+ content => template('jrockit/jrockit-silent.xml.erb'),
require => File[$path],
}
-
+
# Do the installation but only if the directry doesn't exist
- exec { "installjrockit":
- command => "${jdkfile} -mode=silent -silent_xml=${silentfile}",
- cwd => "${path}",
- path => "${path}",
- logoutput => true,
- require => File["silent.xml ${version}"],
- creates => "${jreInstallDir}/${fullversion}",
+ exec { 'installjrockit':
+ command => "${jdkfile} -mode=silent -silent_xml=${silentfile}",
+ cwd => $path,
+ path => $path,
+ logoutput => true,
+ require => File["silent.xml ${version}"],
+ creates => "${jreInstallDir}/${fullversion}",
}
-
- # java link to latest
+
+ # java link to latest
file { "${jreInstallDir}/latest":
- ensure => link,
- target => "${jreInstallDir}/${fullversion}",
- mode => 0755,
- require => Exec["installjrockit"],
+ ensure => link,
+ target => "${jreInstallDir}/${fullversion}",
+ mode => '0755',
+ require => Exec['installjrockit'],
}
- # java link to default
+ # java link to default
file { "${jreInstallDir}/default":
- ensure => link,
- target => "${jreInstallDir}/latest",
- mode => 0755,
- require => File["${jreInstallDir}/latest"],
+ ensure => link,
+ target => "${jreInstallDir}/latest",
+ mode => '0755',
+ require => File["${jreInstallDir}/latest"],
}
# Add to alternatives and set as the default if required
- case $operatingsystem {
+ case $::operatingsystem {
CentOS, RedHat, OracleLinux: {
- # set the java default
- exec { "install alternatives":
+ # set the java default
+ exec { 'install alternatives':
command => "alternatives --install /usr/bin/java java ${jreInstallDir}/${fullversion}/bin/java 17065",
require => File["${jreInstallDir}/default"],
}
- if $setDefault == 'true' {
- exec { "default alternatives":
+ if $setDefault == true {
+ exec { 'default alternatives':
command => "alternatives --set java ${jreInstallDir}/${fullversion}/bin/java",
require => Exec['install alternatives'],
}
}
}
- Ubuntu, Debian:{
- # set the java default
- exec { "install alternatives":
+ Ubuntu, Debian: {
+ # set the java default
+ exec { 'install alternatives':
command => "update-alternatives --install /usr/bin/java java ${jreInstallDir}/${fullversion}/bin/java 17065",
require => File["${jreInstallDir}/default"],
}
- if $setDefault == 'true' {
- exec { "default alternatives":
+ if $setDefault == true {
+ exec { 'default alternatives':
command => "update-alternatives --set java ${jreInstallDir}/${fullversion}/bin/java",
require => Exec['install alternatives'],
}
}
-
+ }
+ default: {
+ fail('Unrecognized operating system')
}
}
}
+ default: {
+ fail('Unrecognized operating system')
+ }
}
}

0 comments on commit 15e94ef

Please sign in to comment.