install gerrit core plugins

This change configures puppet to install core plugins which are packaged with
the released gerrit.war file.  The method to install the plugins is to just extract
them from the war file and place them into review_site/plugins folder.  This method seemed
easier than using the 'init --install-plugin' option because the --install-plugin
option requires listing every plugin by name.

Change-Id: I08335f970cee9e88d41c3695fccb370d05d1a4d1
This commit is contained in:
Khai Do 2014-01-07 13:02:44 -08:00
parent af54442af0
commit 75cee29cd6

View File

@ -166,6 +166,10 @@ class gerrit(
}
}
package { 'unzip':
ensure => present,
}
package { 'openjdk-7-jre-headless':
ensure => present,
}
@ -507,8 +511,7 @@ class gerrit(
Mysql::Db['reviewdb'],
File['/home/gerrit2/review_site/etc/gerrit.config'],
File['/home/gerrit2/review_site/etc/secure.config']],
notify => Exec['gerrit-start'],
unless => '/usr/bin/test -f /etc/init.d/gerrit',
notify => Exec['install-core-plugins'],
logoutput => true,
}
@ -526,8 +529,19 @@ class gerrit(
Mysql::Db['reviewdb'],
File['/home/gerrit2/review_site/etc/gerrit.config'],
File['/home/gerrit2/review_site/etc/secure.config']],
notify => Exec['install-core-plugins'],
logoutput => true,
}
# Install Core Plugins
exec { 'install-core-plugins':
user => 'gerrit2',
command => '/usr/bin/unzip -jo /home/gerrit2/review_site/bin/gerrit.war WEB-INF/plugins/* -d /home/gerrit2/review_site/plugins || true',
subscribe => File['/home/gerrit2/review_site/bin/gerrit.war'],
require => [Package['unzip'],
File['/home/gerrit2/review_site/plugins']],
notify => Exec['gerrit-start'],
onlyif => '/usr/bin/test -f /etc/init.d/gerrit',
unless => '/usr/bin/test -f /etc/init.d/gerrit',
logoutput => true,
}