Fix undefined plugindir file resource, poor variable sourcing

The elasticsearch::plugin resource completely fails to work in the current version of puppet. This is due to the fact that it is accessing variables outside it's scope, thus making the install_plugin exec require File[undef]. This change causes the plugin resource to include elasticsearch, allowing it to access the required plugindir variable. It then ensures that File[$elasticsearch::plugindir] is actually defined and defines that resource as the required metaparameter for the exec.