mirror of
https://github.com/aljazceru/ansible-elasticsearch.git
synced 2025-12-18 17:44:20 +01:00
Only use es_api_host in API calls since es_config['network.host'] is not a reliable source
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
service: name={{instance_init_script | basename}} state=started enabled=yes
|
service: name={{instance_init_script | basename}} state=started enabled=yes
|
||||||
|
|
||||||
- name: Wait for elasticsearch to startup
|
- name: Wait for elasticsearch to startup
|
||||||
wait_for: host={% if es_config['network.host'] is defined %}{{es_config['network.host']}}{% else %}{{es_api_host}}{% endif %} port={% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %} delay=10
|
wait_for: host="{{es_api_host}}" port={% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %} delay=10
|
||||||
|
|
||||||
- name: Get template files
|
- name: Get template files
|
||||||
find: paths="/etc/elasticsearch/templates" patterns="*.json"
|
find: paths="/etc/elasticsearch/templates" patterns="*.json"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
- name: Install templates without auth
|
- name: Install templates without auth
|
||||||
uri:
|
uri:
|
||||||
url: "http://{% if es_config['network.host'] is defined %}{{es_config['network.host']}}{% else %}{{es_api_host}}{% endif %}:{% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %}/_template/{{item.path | filename}}"
|
url: "http://{{es_api_host}}:{% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %}/_template/{{item.path | filename}}"
|
||||||
method: PUT
|
method: PUT
|
||||||
status_code: 200
|
status_code: 200
|
||||||
body_format: json
|
body_format: json
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
- name: Install templates with auth
|
- name: Install templates with auth
|
||||||
uri:
|
uri:
|
||||||
url: "http://{% if es_config['network.host'] is defined %}{{es_config['network.host']}}{% else %}{{es_api_host}}{% endif %}:{% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %}/_template/{{item.path | filename}}"
|
url: "http://{{es_api_host}}:{% if es_config['http.port'] is defined %}{{es_config['http.port']}}{% else %}{{es_api_port}}{% endif %}/_template/{{item.path | filename}}"
|
||||||
method: PUT
|
method: PUT
|
||||||
status_code: 200
|
status_code: 200
|
||||||
user: "{{es_api_basic_auth_username}}"
|
user: "{{es_api_basic_auth_username}}"
|
||||||
|
|||||||
Reference in New Issue
Block a user