-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add selenium::install class with simple download support
- Loading branch information
Joshua Hoblitt
committed
Oct 1, 2013
1 parent
eb724de
commit b08a9b9
Showing
7 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# == Class: megaraid::lsiget | ||
# | ||
# installs the `lsiget` utility for LSI MegaRAID controllers | ||
# | ||
# See: http://mycusthelp.info/LSI/_cs/AnswerDetail.aspx?inc=8264 | ||
# | ||
# | ||
# === Parameters | ||
# | ||
# Accepts no parameters. | ||
# | ||
# | ||
# === Examples | ||
# | ||
# class{ 'megaraid::lsiget': } | ||
# | ||
# | ||
# === Authors | ||
# | ||
# Joshua Hoblitt <[email protected]> | ||
# | ||
# | ||
class selenium::install( | ||
$version = '2.35.0', | ||
$url = undef, | ||
) inherits selenium::server { | ||
validate_string($version) | ||
validate_string($url) | ||
|
||
include wget | ||
|
||
$jar_name = "selenium-server-standalone-${version}.jar" | ||
|
||
if $url { | ||
$jar_url = $url | ||
} else { | ||
$jar_url = "https://selenium.googlecode.com/files/${jar_name}" | ||
} | ||
|
||
File { | ||
owner => $selenium::server::user, | ||
group => $selenium::server::group, | ||
} | ||
|
||
file { $selenium::server::install_path: | ||
ensure => directory, | ||
} | ||
|
||
$jar_path = "${selenium::server::install_path}/jars" | ||
|
||
file { $jar_path: | ||
ensure => directory, | ||
} | ||
|
||
wget::fetch { 'selenium-server-standalone': | ||
source => $jar_url, | ||
destination => "${selenium::server::jar_path}/${jar_name}", | ||
timeout => 30, | ||
require => File[$jar_path], | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'spec_helper' | ||
|
||
describe 'selenium::install' do | ||
let(:title) { 'redhat' } | ||
let(:facts) {{ :osfamily=> 'RedHat' }} | ||
|
||
it do | ||
should include_class('wget') | ||
should contain_class('selenium::install').with_version('2.35.0') | ||
should contain_file('/opt/selenium').with_ensure('directory') | ||
should contain_wget__fetch('selenium-server-standalone') | ||
end | ||
|
||
end |