-
Notifications
You must be signed in to change notification settings - Fork 196
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
Fixes for Elasticsearch issue #184 - Testing Elasticsearch functionality when network.host is not localhost. #212
Conversation
Please @rshad , change the PR title. |
@@ -2,7 +2,8 @@ | |||
elasticsearch_cluster_name: wazuh | |||
elasticsearch_node_name: node-1 | |||
elasticsearch_http_port: 9200 | |||
elasticsearch_network_host: 127.0.0.1 | |||
elasticsearch_network_host: 0.0.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should set this default value as 127.0.0.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -26,7 +26,7 @@ | |||
|
|||
- name: Install Oracle Java 8 | |||
become: true | |||
apt: name=openjdk-8-jdk state=latest | |||
apt: name=openjdk-8-jdk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the state=latest
statement not needed anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @manuasir,
This change came as result to Ansible-Linting error:
Package installs should not use latest
reported in this issue: ansible/ansible-lint#479
This change was made in this commit: ansible/ansible-lint@f5fcee4#diff-42252eea388ddb7d54414f584e9ebc78.
Sincerely, and like many other users facing this issue, I think this restriction has no logic due to the need to upgrade a package to its latest version without worrying about specifying a determined one.
Anyway, I think apt
will take the last version by default, so no worries.
Kind regards,
Rshad
Hi team!
In this PR, we resolved the error reported in the issue #184.
As @kravietz reported
To solve such issue it's needed to have 2 different variables, 1 for network.host and one for representing Elasticsearch host. In this case, we now have:
elasticsearch_network_host: 0.0.0.0
: Indicates the hosts which Elasticsearch API will accepts requests from.elasticsearch_host: 127.0.0.1
: By now, it's used to check if Elasticsearch is running by checking if 127.0.0.1:9200 is available.wazuh-ansible/roles/elastic-stack/ansible-elasticsearch/tasks/main.yml
Lines 261 to 265 in fcb584a
wazuh-ansible/roles/elastic-stack/ansible-elasticsearch/defaults/main.yml
Lines 4 to 6 in fcb584a
In this case, we set
elasticsearch_host
to127.0.0.1
instead of0.0.0.0
because0.0.0.0
will not be considered as a valid IP, but will refer to the big-world domain.We also fixed some Ansible-Linting errors by refactoring Ansible tasks in the role of
Elasticsearch
.Kind regards,
Rshad