Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

31 lines (25 sloc) 0.965 kb
# Install ElasticSearch plugin
#
define :install_plugin do
bash "/usr/local/bin/plugin -install #{node.elasticsearch[:plugin][params[:name].intern][:url]}" do
user "root"
code "/usr/local/bin/plugin -install #{node.elasticsearch[:plugin][params[:name].intern][:url]}"
notifies :restart, resources(:service => 'elasticsearch')
not_if do
begin
Dir.entries("#{node.elasticsearch[:dir]}/elasticsearch-#{node.elasticsearch[:version]}/plugins/").any? do |entry|
begin
puts "Does #{entry} match the plugin name for #{params[:name]} ???"
puts node.elasticsearch[:plugin][params[:name].intern][:name].eql? entry
node.elasticsearch[:plugin][params[:name].intern][:name].eql? entry
rescue
false
end
end
rescue
puts "No plugins have been installed yet, even the plugins directory doesn't exist..."
false
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.