lusis / chef-logstash

Semi-official Logstash cookbook
Other
271 stars 353 forks source link

plugin guard not working #480

Open danhiris opened 7 years ago

danhiris commented 7 years ago

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

martinb3 commented 7 years ago

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 :)

danhiris commented 7 years ago

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')

nikhilo commented 7 years ago

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