Refactor to accept java_home from parent modules

The java_home is needed in review.pp and review-dev.pp (in
system-config) so instead of defining it in here allow a parent
module to pass in the value.

Change-Id: I5e817fab8a8973b688fd44dd819e3616df171321
This commit is contained in:
Khai Do 2016-06-19 22:42:44 -07:00
parent 1eefbbb653
commit 0b209db93b
3 changed files with 6 additions and 5 deletions

View File

@ -127,6 +127,8 @@
# 'scheme' => ['ssh', 'anon_http', 'anon_git'], # 'scheme' => ['ssh', 'anon_http', 'anon_git'],
# 'archive' => ['tar', 'tbz2', 'tgz', 'txz'], # 'archive' => ['tar', 'tbz2', 'tgz', 'txz'],
# }, # },
# java_home:
# The path to java home directory
# TODO: make more gerrit options configurable here # TODO: make more gerrit options configurable here
# #
class gerrit( class gerrit(
@ -222,6 +224,7 @@ class gerrit(
$cache_diff_timeout = '', $cache_diff_timeout = '',
$cache_diff_intraline_timeout = '', $cache_diff_intraline_timeout = '',
$download = {}, $download = {},
$java_home = '/usr/lib/jvm/java-7-openjdk-amd64/jre',
) { ) {
include ::httpd include ::httpd
@ -230,11 +233,6 @@ class gerrit(
} }
include ::pip include ::pip
$java_home = $::lsbdistcodename ? {
'precise' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
'trusty' => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
}
# get the war version from the passed in url, expecting something like # get the war version from the passed in url, expecting something like
# http://tarballs.openstack.org/ci/gerrit/gerrit-v2.10.2.22.acc615e.war # http://tarballs.openstack.org/ci/gerrit/gerrit-v2.10.2.22.acc615e.war
$split1 = split($war, '/') $split1 = split($war, '/')

View File

@ -21,6 +21,7 @@ class { '::gerrit::mysql':
} }
class { '::gerrit': class { '::gerrit':
java_home => '/usr/lib/jvm/java-7-openjdk-amd64/jre',
mysql_host => 'localhost', mysql_host => 'localhost',
mysql_password => '12345', mysql_password => '12345',
war => 'http://tarballs.openstack.org/ci/test/gerrit-v2.11.4.13.cb9800e.war', war => 'http://tarballs.openstack.org/ci/test/gerrit-v2.11.4.13.cb9800e.war',

View File

@ -48,7 +48,9 @@
includeDiff = <%= @sendemail_include_diff %> includeDiff = <%= @sendemail_include_diff %>
[container] [container]
user = gerrit2 user = gerrit2
<% if @java_home != "" -%>
javaHome = <%= @java_home %> javaHome = <%= @java_home %>
<% end -%>
<% if @container_javaoptions != "" -%> <% if @container_javaoptions != "" -%>
javaOptions = <%= @container_javaoptions %> javaOptions = <%= @container_javaoptions %>
<% end -%> <% end -%>