Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout in wget/exec #53

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ language: ruby
rvm:
- 1.9.3
- ruby-head
bundler_args: --without development
script:
- "bundle exec rake lint"
- "bundle exec rake spec SPEC_OPTS='--format documentation'"
Expand All @@ -21,4 +22,4 @@ matrix:
gemfile: .gemfile
notifications:
email:
- travisci@tylerwalts.com
- eurides.baptistella@gmail.com
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ site.pp:
* Boolean to indicate if the installed java version is linked as the default java, javac etc...
* ensure
* Boolean to disable anything from happening (absent/removal not supported yet)
* download_timeout
* Integer Timeout for download (wget) in seconds. Default is 600s
41 changes: 23 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,28 @@
# String. Specifies if jdk should be installed or absent
# Defaults to <tt>installed</tt>.
#
# [* download_timeout *]
# Integer. Timeout for download (wget) in seconds
# Defaults to <tt>600</tt> seconds.
#
class jdk_oracle(
$version = hiera('jdk_oracle::version', '8' ),
$version_update = hiera('jdk_oracle::version_update', 'default' ),
$version_build = hiera('jdk_oracle::version_build', 'default' ),
$install_dir = hiera('jdk_oracle::install_dir', '/opt' ),
$use_cache = hiera('jdk_oracle::use_cache', false ),
$cache_source = 'puppet:///modules/jdk_oracle/',
$platform = hiera('jdk_oracle::platform', 'x64' ),
$jce = hiera('jdk_oracle::jce', false ),
$default_java = hiera('jdk_oracle::default_java', true ),
$ensure = 'installed'
$version = hiera('jdk_oracle::version', '8' ),
$version_update = hiera('jdk_oracle::version_update', 'default' ),
$version_build = hiera('jdk_oracle::version_build', 'default' ),
$install_dir = hiera('jdk_oracle::install_dir', '/opt' ),
$use_cache = hiera('jdk_oracle::use_cache', false ),
$cache_source = 'puppet:///modules/jdk_oracle/',
$platform = hiera('jdk_oracle::platform', 'x64' ),
$jce = hiera('jdk_oracle::jce', false ),
$default_java = hiera('jdk_oracle::default_java', true ),
$ensure = 'installed',
$download_timeout = hiera('jdk_oracle::download_timeout', 600 ),
) {

$default_8_update = '11'
$default_8_build = '12'
$default_7_update = '67'
$default_7_build = '01'
$default_8_update = '51'
$default_8_build = '16'
$default_7_update = '80'
$default_7_build = '15'
$default_6_update = '45'
$default_6_build = '06'

Expand Down Expand Up @@ -143,8 +148,8 @@
exec { 'get_jdk_installer':
cwd => $install_dir,
creates => "${install_dir}/${installerFilename}",
command => "wget -c --no-cookies --no-check-certificate --header \"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com\" --header \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${javaDownloadURI}\" -O ${installerFilename}",
timeout => 600,
command => "wget -c -T ${download_timeout} --no-cookies --no-check-certificate --header \"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com\" --header \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${javaDownloadURI}\" -O ${installerFilename}",
timeout => $download_timeout,
require => Package['wget'],
}

Expand Down Expand Up @@ -284,8 +289,8 @@
exec { 'get_jce_package':
cwd => $install_dir,
creates => "${install_dir}/${jceFilename}",
command => "wget -c --no-cookies --no-check-certificate --header \"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com\" --header \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${jceDownloadURI}\" -O ${jceFilename}",
timeout => 600,
command => "wget -c -T ${download_timeout} --no-cookies --no-check-certificate --header \"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com\" --header \"Cookie: oraclelicense=accept-securebackup-cookie\" \"${jceDownloadURI}\" -O ${jceFilename}",
timeout => $download_timeout,
require => Package['wget'],
}

Expand Down