kolla-ansible/ansible/roles/kibana/tasks/post_config.yml
Borne Mace f27d89aa09 Increased mariadb and kibana timeouts
In some deployment scenarios the current timeouts
for mariadb bootstrap and kibana registration with
elasticsearch have been found to be too short. These
timeout increases shouldn't introduce any deployment
slowdown in current environment and eliminate
deployment failures in environments with slower
systems.

Change-Id: If33dfff2b42b23eff7ec2230c9b0c5a4c010072e
2017-12-12 12:07:26 -08:00

80 lines
2.5 KiB
YAML

---
- name: Wait for kibana port
wait_for:
host: "{{ kolla_internal_vip_address }}"
port: "{{ kibana_server_port }}"
run_once: true
- name: Wait for kibana to register in elasticsearch
uri:
url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ elasticsearch_port }}/.kibana"
status_code: 200
register: result
until: result.status == 200
retries: 20
delay: 2
run_once: true
- name: Get kibana default indexes
uri:
HEADER_Content-Type: application/json
url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ elasticsearch_port }}/.kibana"
method: GET
register: kibana_default_indexes
run_once: true
when: kibana_default_index is defined
- name: Set kibana default indexes fact
set_fact:
kibana_default_indexes: "{{ kibana_default_indexes.json | default([]) }}"
when:
- kibana_default_indexes is defined
run_once: true
connection: local
- name: Add index pattern to kibana
uri:
url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ elasticsearch_port }}/.kibana/index-pattern/{{ kibana_default_index_pattern }}"
method: PUT
body: "{{ kibana_default_index | to_json }}"
body_format: json
status_code: 201
run_once: true
when:
- kibana_default_index is defined
- kibana_default_indexes is defined
- kibana_default_indexes['.kibana']['mappings']['config']['properties']['defaultIndex'] is not defined
- name: Find kibana version
command: docker exec -t kibana /opt/kibana/bin/kibana --version
register: kibana_version
run_once: true
changed_when: true
when:
- kibana_default_index is defined
- kibana_default_indexes is defined
- kibana_default_indexes['.kibana']['mappings']['config']['properties']['defaultIndex'] is not defined
- set_fact:
kibana_version: "{{ kibana_version.stdout }}"
run_once: true
connection: local
when:
- kibana_default_index is defined
- kibana_default_indexes is defined
- kibana_default_indexes['.kibana']['mappings']['config']['properties']['defaultIndex'] is not defined
- name: Change kibana config to set index as defaultIndex
uri:
url: "http://{{ kolla_internal_vip_address }}:{{ elasticsearch_port }}/.kibana/config/{{ kibana_version }}"
method: PUT
body:
defaultIndex: "{{ kibana_default_index_pattern }}"
body_format: json
status_code: 200
run_once: true
when:
- kibana_default_index is defined
- kibana_default_indexes is defined
- kibana_default_indexes['.kibana']['mappings']['config']['properties']['defaultIndex'] is not defined