X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Felasticsearch%2Fmanifests%2Fplugin.pp;h=9cd04484e874abfe29c69c5230f408aa9c5417ae;hb=8efe10c37b152ebbf7fd051ea13ddd2b06d43e77;hp=f0166a371801666ceaf439465e106a969e997c90;hpb=db99607dc790cf9ef180ca5ff1c4ee5f202bc8c6;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/elasticsearch/manifests/plugin.pp b/3rdparty/modules/elasticsearch/manifests/plugin.pp index f0166a371..9cd04484e 100644 --- a/3rdparty/modules/elasticsearch/manifests/plugin.pp +++ b/3rdparty/modules/elasticsearch/manifests/plugin.pp @@ -77,6 +77,7 @@ define elasticsearch::plugin( user => $elasticsearch::elasticsearch_user, tries => 6, try_sleep => 10, + timeout => 600, } $notify_service = $elasticsearch::restart_on_change ? { @@ -107,6 +108,12 @@ define elasticsearch::plugin( case $ensure { 'installed', 'present': { + $name_file_path = "${elasticsearch::plugindir}/${module_dir}/.name" + exec {"purge_plugin_${module_dir}_old": + command => "${elasticsearch::plugintool} --remove ${module_dir}", + onlyif => "test -e ${elasticsearch::plugindir}/${module_dir} && test \"$(cat ${name_file_path})\" != '${name}'", + before => Exec["install_plugin_${name}"], + } exec {"install_plugin_${name}": command => $install_cmd, creates => "${elasticsearch::plugindir}/${module_dir}", @@ -114,6 +121,11 @@ define elasticsearch::plugin( notify => $notify_service, require => File[$elasticsearch::plugindir], } + file {$name_file_path: + ensure => file, + content => $name, + require => Exec["install_plugin_${name}"], + } } default: { exec {"remove_plugin_${name}":