Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch_plugin: wrong binary and unsupported "timeout" option. #21989

Closed
dobegor opened this issue Feb 27, 2017 · 6 comments
Closed

elasticsearch_plugin: wrong binary and unsupported "timeout" option. #21989

dobegor opened this issue Feb 27, 2017 · 6 comments
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.

Comments

@dobegor
Copy link

dobegor commented Feb 27, 2017

ISSUE TYPE
  • Bug Report
COMPONENT NAME

elasticsearch_plugin

ANSIBLE VERSION

devel

CONFIGURATION

None.

OS / ENVIRONMENT

Ubuntu 16.04 64-bit

SUMMARY

Ansible uses wrong binary by default and passes an unsupported option to plugin installer, so it crashes.

STEPS TO REPRODUCE

Define a plugin install action.

- name: "Install discovery plugin"
  elasticsearch_plugin:
    state: present
    name: discovery-gce
EXPECTED RESULTS

Plugin installed.

ACTUAL RESULTS
fatal: [localhost]: FAILED! => {"changed": false, "cmd": "/usr/share/elasticsearch/bin/plugin install discovery-gce --timeout 1m", "failed": true, "msg": "[Errno 2] No such file or directory", "rc": 2}

OK, default binary is wrong. If I specify the correct binary explicitly, the result is:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "A tool for managing installed elasticsearch plugins\n\nCommands\n--------\nlist - Lists installed elasticsearch plugins\ninstall - Install a plugin\nremove - Removes a plugin from elasticsearch\n\nNon-option arguments:\ncommand              \n\nOption         Description        \n------         -----------        \n-h, --help     show help          \n-s, --silent   show minimal output\n-v, --verbose  show verbose output\nERROR: timeout is not a recognized option\n"}

The problem is that there's no timeout option now in elasticsearch-plugin. Please remove it.
Line

@ansibot
Copy link
Contributor

ansibot commented Feb 27, 2017

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Feb 27, 2017
@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Feb 27, 2017
@ApsOps
Copy link
Contributor

ApsOps commented Mar 2, 2017

@bcoca I can pick this up, but I'm not sure if we should enable/disable the option by checking the ES version (this might be complicated/overkill), or just remove the default value and add in docs that users should enable this only if their elasticsearch-plugin binary supports it. Users are anyway providing the path to the binary. Thoughts?

@ThePixelDeveloper
Copy link

@ApsOps Thanks.

I'm not going to have any time in the next few days so it's much appreciated if someone can get to this before me.

@ghost
Copy link

ghost commented Jun 14, 2017

I fixed this in a new pull-request. The default binary was not changed, but can be edited with the plugin_bin parameter.

regards

@ansibot ansibot added the support:community This issue/PR relates to code supported by the Ansible community. label Jun 29, 2017
samdoran added a commit to samdoran/ansible that referenced this issue Sep 1, 2017
Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes ansible#21989
samdoran added a commit that referenced this issue Sep 7, 2017
* Update elasticsearch_plugin.py

Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes #21989

* Check system paths for elasticsearch-plugin binary

Use get_bin_path from basic.py for searching paths.

* Create a copy of PLUGIN_BIN_PATHS rather than modifying the global

* Use provided plugin_bin path first before trying other places

Change global PLUGIN_BIN_PATHS to a tuple
prasadkatti pushed a commit to prasadkatti/ansible that referenced this issue Oct 1, 2017
* Update elasticsearch_plugin.py

Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes ansible#21989

* Check system paths for elasticsearch-plugin binary

Use get_bin_path from basic.py for searching paths.

* Create a copy of PLUGIN_BIN_PATHS rather than modifying the global

* Use provided plugin_bin path first before trying other places

Change global PLUGIN_BIN_PATHS to a tuple
@ansibot
Copy link
Contributor

ansibot commented Oct 4, 2017

samdoran added a commit that referenced this issue Oct 4, 2017
* Update elasticsearch_plugin.py

Change module to work with Elasticsearch 2.x and 5.x automatically.
Update examples and docs.
Supersedes #21989

* Check system paths for elasticsearch-plugin binary

Use get_bin_path from basic.py for searching paths.

* Create a copy of PLUGIN_BIN_PATHS rather than modifying the global

* Use provided plugin_bin path first before trying other places

Change global PLUGIN_BIN_PATHS to a tuple

(cherry picked from commit a5ee865)
@samdoran
Copy link
Contributor

samdoran commented Oct 4, 2017

Closing this since it was resolved by #28936, which will be in Ansible 2.4.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

No branches or pull requests

6 participants