elastic / ansible-elasticsearch

Ansible playbook for Elasticsearch
Other
1.58k stars 854 forks source link

Issue with "Get the installed java path" in java.yml task #721

Closed zacharystokes closed 3 years ago

zacharystokes commented 4 years ago

Describe the feature:

Elasticsearch version 6.8.13 Role version: (If using master please specify github sha) 7.9.1 - latest JVM version (java -version): 1.8.0_251 OS version (uname -a if on a Unix-like system): RHEL 7.8 3.10.0-1127.13.1.el7.x86_64 #1 SMP Fri Jun 12 14:34:17 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux Description of the problem including expected versus actual behaviour: When a RedHat system has multiple distros of Java installed of the same version then the command shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0 | head -1" cannot distinguish between the two distros.

For example:

# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           /usr/lib/jvm/java-1.8.0-ibm-1.8.0.6.10-1jpp.1.el7.x86_64/jre/bin/java
*  2           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/java)

If I replace 1.8.0 with 1.8.0-openjdk in this instance, the playbook runs to completion (if I first remove /etc/elasticsearch/elasticsearch.keystore/tmp)

Playbook: elastic.yaml (java.yaml within the Role)

Provide logs from Ansible:

ES Logs if relevant:

jmlrt commented 4 years ago

Hi @zacharystokes, thanks for submitting this issue.

As you mentionned, this should be fixed by replacing shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0 | head -1" by shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0-openjdk | head -1".

Do you think you could create a PR?

zacharystokes commented 4 years ago

Hello Julian,

I have been told I can issue a Pull Request so long as there is no CLA or (contributor license agreement) since I submitted with my corporate email account.

Happy to do so if that answer is no.

Best, Z

On Fri, Oct 2, 2020 at 3:12 AM Julien Mailleret notifications@github.com wrote:

Hi @zacharystokes https://github.com/zacharystokes, thanks for submitting this issue.

As you mentionned, this should be fixed by replacing shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0 | head -1" by shell: "update-alternatives --display java | grep '^/' | awk '{print $1}' | grep 1.8.0-openjdk | head -1".

Do you think you could create a PR?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elastic/ansible-elasticsearch/issues/721#issuecomment-702645862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMSTAEK7P6HDW7T3ITU6WTSIWRP5ANCNFSM4RNZCL3Q .

jmlrt commented 4 years ago

Hi @zacharystokes, Unfortunately submitting PR requires signing CLA.

zacharystokes commented 4 years ago

Okay, still probably okay just I'll have to have it reviewed before I can submit. Thanks, Z

On Wed, Oct 7, 2020 at 4:08 AM Julien Mailleret notifications@github.com wrote:

Hi @zacharystokes https://github.com/zacharystokes, Unfortunately submitting PR requires signing CLA.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/elastic/ansible-elasticsearch/issues/721#issuecomment-704863175, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMSTAAQNIONYPYH5NADKBLSJRD2JANCNFSM4RNZCL3Q .

botelastic[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.