I created a puppet defined type to handle logstash plugins install/removal automatically.
define logstash::plugin (
$command = install,
$logoutput = true,
) {
exec {
"$name":
command => "/opt/logstash/bin/plugin $command $name",
logoutput => $logoutput,
path => ["/bin", "/sbin", "/usr/bin", "/usr/sbin"],
unless => "/opt/logstash/bin/plugin list $name",
;
}
}
before attempting anything, it checks if the plugin is already installed by issuing the list command
/opt/logstash/bin/plugin list $name
i would like to do the same with elasticsearch plugins, but issuing a similar command
/usr/share/elasticsearch/bin/plugin list $name
always return all installed plugins
is there any way to get it to accept a plugin name as argument and return only that given name, like logstash plugin above?