Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from EslamElHusseiny/master
Browse files Browse the repository at this point in the history
fix bunch of puppet-lint issues
  • Loading branch information
cornelf committed Jun 19, 2015
2 parents a1b8c1f + 898835e commit ac358be
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Install oracle jdk and make it default one.
class java (
$source_url = "https://download.oracle.com/otn-pub/java/jdk/7u79-b15",
$source_url = 'https://download.oracle.com/otn-pub/java/jdk/7u79-b15',
$java_major_version = 7,
$java_minor_version = 79,
) {
Expand All @@ -10,33 +11,33 @@
include ::wget

wget::fetch { 'jdk':
source => "${source_url}/$java_filename",
no_cookies => true,
headers => ['Cookie: oraclelicense=accept-securebackup-cookie;'],
destination => "/usr/local/$java_filename",
timeout => 0,
nocheckcertificate => true,
verbose => false,
source => "${source_url}/${java_filename}",
no_cookies => true,
headers => ['Cookie: oraclelicense=accept-securebackup-cookie;'],
destination => "/usr/local/${java_filename}",
timeout => 0,
nocheckcertificate => true,
verbose => false,
}

package {'java':
provider => rpm,
name => "jdk",
ensure => "1.${java_major_version}.0_${java_minor_version}-fcs",
source => "/usr/local/$java_filename",
provider => rpm,
name => 'jdk',
source => "/usr/local/${java_filename}",
require => Wget::Fetch['jdk'],
}
->
file { '/etc/profile.d/java.sh':
ensure => file,
owner => root,
group => root,
mode => 644,
content => "export JAVA_HOME=/usr/java/default",
mode => '0644',
content => 'export JAVA_HOME=/usr/java/default',
}
->
exec { 'update-java-alternatives':
path => "/bin:/usr/bin:/usr/sbin",
path => '/bin:/usr/bin:/usr/sbin',
command => "alternatives --install /usr/bin/java java /usr/java/jdk1.${java_major_version}.0_${java_minor_version}/bin/java 200000",
unless => "[ `ls -l /etc/alternatives/java | awk '{print \$11}'` == '/usr/java/jdk1.${java_major_version}.0_${java_minor_version}/bin/java' ]"
}
Expand Down

0 comments on commit ac358be

Please sign in to comment.