Not sure if if this is a change as of puppet 3.5, but it appears that you cannot use variables outside of your own scope unless you include the scope the variables come from. Attempting to use $elasticsearch::plugindir without the "include elasticsearch" line results in undef.