chef-logstash icon indicating copy to clipboard operation
chef-logstash copied to clipboard

plugin guard not working

Open danhiris opened this issue 7 years ago • 3 comments

The plugin install executes on every chef run. I assume the guard isn't correct.

  • execute bin/plugin install logstash-input-s3
  • logstash_plugins[logstash-output-loggly] action create (up to date)
  • execute[bin/plugin install logstash-output-loggly] action run [execute] Validating logstash-output-loggly Installing logstash-output-loggly Installation successful

danhiris avatar Jul 05 '17 22:07 danhiris

Could you let us know which versions of logstash and which plugin versions you're installing? There's a lot of cleanup needed on this project, and it would save a lot of time if you had those handy :)

martinb3 avatar Jul 06 '17 13:07 martinb3

Appears that it keeps running the plugin install on all versions on any type of plugins. I used logstash 1.x, 2.x, 5.x, and logstash-input-s3, logstash-output-loggy, ... in different versions.

    ex = execute "bin/plugin install #{ls_name}" do
...
      not_if { ::File.exist?("#{ls_instance_dir}/#{ls_install_check}") }

Not quite sure what the following code does, but this is where that ls_install_check comes from. If I look in the instance dir, I don't see any files that would be indicative of a plugin having been installed.

@install_check = new_resource.install_check || Logstash.get_attribute_or_default(node, @instance, 'plugins_check_if_installed')

danhiris avatar Jul 06 '17 21:07 danhiris

Looks like the only place it can/should check, is here:

root@logstash:~# find /opt/logstash/agent/ -type d -name "logstash-filter-alter*"
/opt/logstash/agent/vendor/bundle/jruby/1.9/gems/logstash-filter-alter-3.0.2

nikhilo avatar Aug 16 '17 18:08 nikhilo