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

Revert "fix bunch of puppet-lint issues" #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# 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 @@ -11,33 +10,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':
ensure => "1.${java_major_version}.0_${java_minor_version}-fcs",
provider => rpm,
name => 'jdk',
source => "/usr/local/${java_filename}",
name => "jdk",
ensure => "1.${java_major_version}.0_${java_minor_version}-fcs",
source => "/usr/local/$java_filename",
require => Wget::Fetch['jdk'],
}
->
file { '/etc/profile.d/java.sh':
ensure => file,
owner => root,
group => root,
mode => '0644',
content => 'export JAVA_HOME=/usr/java/default',
mode => 644,
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