Fix gerrit plugin installation

The current test to only check for the existance of a plugin file
doesn't work on update scenarios.  The file already exists so it
won't run the install.  Instead we should download the file if it
doesn't already exist and then install after download.

This should install a plugins in 2 cases:
  1. install plugin if there isn't already one in place
  2. install an updated plugin if a new version of the plugin has
     been downloaded

Change-Id: I2422c465011da4500abc9c7d1ae5273c6e5f628a
This commit is contained in:
Khai Do 2016-05-16 16:34:24 -07:00
parent c785f75dda
commit abbf2129a1
1 changed files with 5 additions and 5 deletions

View File

@ -68,11 +68,11 @@ define gerrit::plugin(
}
exec { "install-${base_plugin}":
command => "cp ${plugin_cache_dir}/${plugin} ${plugin_dir}/${base_plugin}",
path => ['/bin','/usr/bin', '/usr/sbin', '/usr/local/bin'],
require => Exec["download-${plugin}"],
user => 'gerrit2',
unless => "test -f ${plugin_dir}/${base_plugin}",
command => "cp ${plugin_cache_dir}/${plugin} ${plugin_dir}/${base_plugin}",
path => ['/bin','/usr/bin', '/usr/sbin', '/usr/local/bin'],
subscribe => Exec["download-${plugin}"],
user => 'gerrit2',
refreshonly => true,
}
}