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

Use elasticsearch_network_host for connection tests if defined #315

Merged
merged 4 commits into from
Feb 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions roles/elasticsearch/tasks/elasticsearch-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@

- name: Check for API with bootstrap password
ansible.builtin.uri:
url: "{{ elasticsearch_http_protocol }}://localhost:{{ elasticstack_elasticsearch_http_port }}"
url: "{{ elasticsearch_http_protocol }}://{{ elasticsearch_network_host|default('localhost') }}:{{ elasticstack_elasticsearch_http_port }}"
user: elastic
password: "{{ elasticsearch_bootstrap_pw }}"
validate_certs: false
Expand All @@ -410,7 +410,7 @@

- name: Check for cluster status with bootstrap password
ansible.builtin.uri:
url: "{{ elasticsearch_http_protocol }}://localhost:{{ elasticstack_elasticsearch_http_port }}/_cluster/health?pretty"
url: "{{ elasticsearch_http_protocol }}://{{ elasticsearch_network_host|default('localhost') }}:{{ elasticstack_elasticsearch_http_port }}/_cluster/health?pretty"
user: elastic
password: "{{ elasticsearch_bootstrap_pw }}"
validate_certs: false
Expand All @@ -437,7 +437,7 @@

- name: Check for API availability with elastic password
ansible.builtin.uri:
url: "{{ elasticsearch_http_protocol }}://localhost:{{ elasticstack_elasticsearch_http_port }}"
url: "{{ elasticsearch_http_protocol }}://{{ elasticsearch_network_host|default('localhost') }}:{{ elasticstack_elasticsearch_http_port }}"
user: elastic
password: "{{ elasticstack_password.stdout }}"
validate_certs: false
Expand Down Expand Up @@ -466,7 +466,7 @@
curl
-k
-X PUT
"{{ elasticsearch_http_protocol }}://elastic:{{ elasticstack_password.stdout }}@localhost:9200/_cluster/settings"
"{{ elasticsearch_http_protocol }}://elastic:{{ elasticstack_password.stdout }}@{{ elasticsearch_network_host|default('localhost') }}:9200/_cluster/settings"
-H 'Content-Type: application/json' -d
'
{
Expand All @@ -488,7 +488,7 @@

- name: Check for cluster status with elastic password
ansible.builtin.uri:
url: "{{ elasticsearch_http_protocol }}://localhost:{{ elasticstack_elasticsearch_http_port }}/_cluster/health?pretty"
url: "{{ elasticsearch_http_protocol }}://{{ elasticsearch_network_host|default('localhost') }}:{{ elasticstack_elasticsearch_http_port }}/_cluster/health?pretty"
user: elastic
password: "{{ elasticstack_password.stdout }}"
validate_certs: false
Expand Down
Loading