From 75cee29cd6be6e044488088b50af76be0c38526e Mon Sep 17 00:00:00 2001 From: Khai Do Date: Tue, 7 Jan 2014 13:02:44 -0800 Subject: [PATCH] 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 --- modules/gerrit/manifests/init.pp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index b636024038..1b2260ae9a 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -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, }