puppet-elasticsearch: plugin install not handling return code 74 for 'Already installed'

Hi,

Thanks for the update for ES2. I am just redoing my puppet code and hiera and it seems that the plugin install work fine first time round and then subsequent runs file due to ES returning exit code 74

Error: Execution of '/usr/share/elasticsearch/bin/plugin install file:///opt/elasticsearch/swdl/license-2.1.0.zip' returned 74: -> Installing from file:/opt/elasticsearch/swdl/license-2.1.0.zip...
Trying file:/opt/elasticsearch/swdl/license-2.1.0.zip ...
Downloading .DONE
Verifying file:/opt/elasticsearch/swdl/license-2.1.0.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
ERROR: plugin directory /usr/share/elasticsearch/plugins/license already exists. To update the plugin, uninstall it first using 'remove license' command
Error: /Stage[main]/Profiles::Elasticsearch/Elasticsearch::Plugin[licence]/Elasticsearch_plugin[licence]/ensure: change from absent to present failed: Execution of '/usr/share/elasticsearch/bin/plugin install file:///opt/elasticsearch/swdl/license-2.1.0.zip' returned 74: -> Installing from file:/opt/elasticsearch/swdl/license-2.1.0.zip...

Does this exit code need catching or is it just me mis-reading the docs? This is my code:

        ::elasticsearch::plugin{'licence':
            instances => $es_shield_instances,
            source    => $licence_source,
            ensure    => present,
        }

and hiera:

profiles::elasticsearch::licence_source: 'puppet:///modules/profiles/elasticsearch/license-2.1.0.zip'
profiles::elasticsearch::es_shield_instances:
    - es-01
    - es-02

Thanks again

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

Thank you @tylerjl for the explaination and the checks. As you stated, in the breaking changes of Elasticsearch 5, plugin installation destination path cannot be customized, so I see no interest on keeping this parameter in the future.

@lucabelluccini I wasn’t super familiar with that parameter so I dug deep in the git history and can confirm that the plugindir parameter never actually installed plugins to different directories, but was exposed to help point the module at a different directory if you were installing plugins there outside of the scope of the module.

I do think that perhaps plugindir needs better documentation in that regard since it appears to not change where bin/plugin installs plugins to; it may even need to be replaced since it seems to be basically a no-op. While path.plugins exists to tell Elasticsearch where to look at to find plugins, that settings was completely removed in 5.x so I’m hesitant to try and add the ability to install plugins to arbitrary directories to the module.