X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Felasticsearch%2Fmanifests%2Fplugin.pp;h=9cd04484e874abfe29c69c5230f408aa9c5417ae;hb=8cd033a69672196c78cedf2ddf0a3f733ad88d5e;hp=f0166a371801666ceaf439465e106a969e997c90;hpb=542fedb190e874d6c8191ddf671f2868007f3b27;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}":