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

Adds the possiblity to force a plugin installation - elasticsearch_plugin module #41688

Merged
merged 1 commit into from Jun 27, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jun 19, 2018

SUMMARY

Some elasticsearch plugins needs an additional confirmation for further permissions in the java. So it's not possible to install these plugins without the --batch mode in the elasticsearch plugin installation process. This mode ignores the confirmation prompt.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

elasticsearch_plugin

ANSIBLE VERSION
ansible 2.5.5
  config file = None
  configured module search path = [u'~/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Library/Python/2.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 2.7.10 (default, Oct  6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
ADDITIONAL INFORMATION

Before:

failed: [node01] (item={u'state': u'present', u'name': u'ingest-geoip'}) => {"changed": false, "err": "-> Downloading ingest-geoip from elastic\n\r[                                                 ] 1%   \r[>                                                ] 2%   \r[>                                                ] 3%   \r[=>                                               ] 4%   \r[=>                                               ] 5%   \r[==>                                              ] 6%   \r[==>                                              ] 7%   \r[===>                                             ] 8%   \r[===>                                             ] 9%   \r[====>                                            ] 10%   \r[====>                                            ] 11%   \r[=====>                                           ] 12%   \r[=====>                                           ] 13%   \r[======>                                          ] 14%   \r[======>                                          ] 15%   \r[=======>                                         ] 16%   \r[=======>                                         ] 17%   \r[========>                                        ] 18%   \r[========>                                        ] 19%   \r[=========>                                       ] 20%   \r[=========>                                       ] 21%   \r[==========>                                      ] 22%   \r[==========>                                      ] 23%   \r[===========>                                     ] 24%   \r[===========>                                     ] 25%   \r[============>                                    ] 26%   \r[============>                                    ] 27%   \r[=============>                                   ] 28%   \r[=============>                                   ] 29%   \r[==============>                                  ] 30%   \r[==============>                                  ] 31%   \r[===============>                                 ] 32%   \r[===============>                                 ] 33%   \r[================>                                ] 34%   \r[================>                                ] 35%   \r[=================>                               ] 36%   \r[=================>                               ] 37%   \r[==================>                              ] 38%   \r[==================>                              ] 39%   \r[===================>                             ] 40%   \r[===================>                             ] 41%   \r[====================>                            ] 42%   \r[====================>                            ] 43%   \r[=====================>                           ] 44%   \r[=====================>                           ] 45%   \r[======================>                          ] 46%   \r[======================>                          ] 47%   \r[=======================>                         ] 48%   \r[=======================>                         ] 49%   \r[========================>                        ] 50%   \r[========================>                        ] 51%   \r[=========================>                       ] 52%   \r[=========================>                       ] 53%   \r[==========================>                      ] 54%   \r[==========================>                      ] 55%   \r[===========================>                     ] 56%   \r[===========================>                     ] 57%   \r[============================>                    ] 58%   \r[============================>                    ] 59%   \r[=============================>                   ] 60%   \r[=============================>                   ] 61%   \r[==============================>                  ] 62%   \r[==============================>                  ] 63%   \r[===============================>                 ] 64%   \r[===============================>                 ] 65%   \r[================================>                ] 66%   \r[================================>                ] 67%   \r[=================================>               ] 68%   \r[=================================>               ] 69%   \r[==================================>              ] 70%   \r[==================================>              ] 71%   \r[===================================>             ] 72%   \r[===================================>             ] 73%   \r[====================================>            ] 74%   \r[====================================>            ] 75%   \r[=====================================>           ] 76%   \r[=====================================>           ] 77%   \r[======================================>          ] 78%   \r[======================================>          ] 79%   \r[=======================================>         ] 80%   \r[=======================================>         ] 81%   \r[========================================>        ] 82%   \r[========================================>        ] 83%   \r[=========================================>       ] 84%   \r[=========================================>       ] 85%   \r[==========================================>      ] 86%   \r[==========================================>      ] 87%   \r[===========================================>     ] 88%   \r[===========================================>     ] 89%   \r[============================================>    ] 90%   \r[============================================>    ] 91%   \r[=============================================>   ] 92%   \r[=============================================>   ] 93%   \r[==============================================>  ] 94%   \r[==============================================>  ] 95%   \r[===============================================> ] 96%   \r[===============================================> ] 97%   \r[================================================>] 98%   \r[================================================>] 99%   \r[=================================================] 100%   \n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n@     WARNING: plugin requires additional permissions     @\n@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n* java.lang.RuntimePermission accessDeclaredMembers\n* java.lang.reflect.ReflectPermission suppressAccessChecks\nSee http://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html\nfor descriptions of what these permissions allow and the associated risks.\n\n", "item": {"name": "ingest-geoip", "state": "present"}, "msg": "Is ingest-geoip a valid plugin name?"}

After:

TASK [elasticsearch : install elasticsearch plugins] ********************************************************************************************************************************************************************************************************************
changed: [node01] => (item={u'state': u'present', u'name': u'ingest-geoip'})

@ghost ghost changed the title Add the possiblity to force a plugin installation - elasticsearch_plugin Modul Adds the possiblity to force a plugin installation - elasticsearch_plugin Modul Jun 19, 2018
@ghost ghost changed the title Adds the possiblity to force a plugin installation - elasticsearch_plugin Modul Adds the possiblity to force a plugin installation - elasticsearch_plugin module Jun 19, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 community_review In order to be merged, this PR must follow the community review workflow. feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. labels Jun 19, 2018
@ryansb ryansb removed the needs_triage Needs a first human triage before being processed. label Jun 19, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 19, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/database/misc/elasticsearch_plugin.py:0:0: E309 version_added for new option (force) should be 2.7. Currently 0.0
lib/ansible/modules/database/misc/elasticsearch_plugin.py:0:0: E324 Value for "default" from the argument_spec ('False') for "force" does not match the documentation (None)

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. community_review In order to be merged, this PR must follow the community review workflow. and removed community_review In order to be merged, this PR must follow the community review workflow. ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 19, 2018
@@ -43,6 +43,11 @@
- "Timeout setting: 30s, 1m, 1h..."
- Only valid for Elasticsearch < 5.0. This option is ignored for Elasticsearch > 5.0.
default: 1m
force:
description:
- "Give the possibility to force a plugin installation even with addition permission needed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the wording on this to align more with the Elatic docs and indicate what this parameter is doing under the hood. Something along the lines of "Force batch mode when installing plugins. This is only necessary if a plugin requires additional permissions and console detection fails."

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I've changed this.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 19, 2018
@samdoran
Copy link
Contributor

Looks good! Please create a changelog fragment and I'll merge this. See fragments for examples.

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jun 21, 2018
@ghost
Copy link
Author

ghost commented Jun 24, 2018

@samdoran Done! ;)

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 24, 2018
@@ -85,6 +90,12 @@
- elasticsearch_plugin:
name: analysis-icu
state: present

# Install a the ingest-geoip plugin with a forced installation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the 'a'.

@@ -0,0 +1,4 @@
---
minor_changes:
- Add the possibility to use the elasticsearch_plugin installation batch mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Start this entry with - elasticsearch_plugin - . This make the module name easier to find when visually scanning the changelogs.

@ansibot ansibot removed the core_review In order to be merged, this PR must follow the core review workflow. label Jun 25, 2018
@ansibot ansibot added the needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. label Jun 25, 2018
@ghost
Copy link
Author

ghost commented Jun 26, 2018

@samdoran done again! ;)

@samdoran samdoran merged commit 26abdbf into ansible:devel Jun 27, 2018
@samdoran
Copy link
Contributor

@nitaco Thank you for all the timely fixes and for your contribution!

@ansible ansible locked and limited conversation to collaborators Jun 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 feature This issue/PR relates to a feature request. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants