Show logs when indices not found
Sometimes CI job are failing because the Gearman service is not up. Also changed url for checking indices from localhost to 0.0.0.0. Change-Id: I69f4345f35c19a72048a842ef8a1360be75bb1e6
This commit is contained in:
@@ -89,34 +89,65 @@
|
|||||||
register: _service_status
|
register: _service_status
|
||||||
failed_when: _service_status.rc != 0
|
failed_when: _service_status.rc != 0
|
||||||
|
|
||||||
# FIXME: The index is created on the beginning of the logsender work.
|
|
||||||
# The playbook should validate if some data has been pushed to the ES.
|
|
||||||
- name: Get Opensearch indices
|
- name: Get Opensearch indices
|
||||||
uri:
|
block:
|
||||||
url: "https://localhost:9200/_cat/indices"
|
- name: Get indices
|
||||||
user: "admin"
|
uri:
|
||||||
password: "admin"
|
url: "https://0.0.0.0:9200/_cat/indices"
|
||||||
force_basic_auth: true
|
user: "admin"
|
||||||
method: GET
|
password: "admin"
|
||||||
validate_certs: false
|
force_basic_auth: true
|
||||||
status_code: "200"
|
method: GET
|
||||||
return_content: true
|
validate_certs: false
|
||||||
register: _opensearch_indices
|
status_code: "200"
|
||||||
until: "'logstash-logscraper' in _opensearch_indices.content"
|
return_content: true
|
||||||
retries: 30
|
register: _opensearch_indices
|
||||||
delay: 10
|
until: "'logstash-logscraper' in _opensearch_indices.content"
|
||||||
|
retries: 30
|
||||||
|
delay: 10
|
||||||
|
|
||||||
- name: Check if build_branch exists in index content
|
- name: Check if build_branch exists in index content
|
||||||
uri:
|
uri:
|
||||||
url: "https://localhost:9200/logstash-logscraper"
|
url: "https://0.0.0.0:9200/logstash-logscraper"
|
||||||
user: "admin"
|
user: "admin"
|
||||||
password: "admin"
|
password: "admin"
|
||||||
force_basic_auth: true
|
force_basic_auth: true
|
||||||
method: GET
|
method: GET
|
||||||
validate_certs: false
|
validate_certs: false
|
||||||
status_code: "200"
|
status_code: "200"
|
||||||
return_content: true
|
return_content: true
|
||||||
register: _opensearch_index_content
|
register: _opensearch_index_content
|
||||||
until: "'build_branch' in _opensearch_index_content.content"
|
until: "'build_branch' in _opensearch_index_content.content"
|
||||||
retries: 30
|
retries: 30
|
||||||
delay: 10
|
delay: 10
|
||||||
|
rescue:
|
||||||
|
- name: List all podman containers
|
||||||
|
shell: |
|
||||||
|
podman ps -a
|
||||||
|
|
||||||
|
- name: Get opensearch logs
|
||||||
|
shell: |
|
||||||
|
podman logs opensearch
|
||||||
|
|
||||||
|
- name: Get logscraper logs
|
||||||
|
shell: |
|
||||||
|
podman logs logscraper-openstack
|
||||||
|
|
||||||
|
- name: Get logsender logs
|
||||||
|
shell: |
|
||||||
|
podman logs logsender-openstack
|
||||||
|
|
||||||
|
- name: Get indices to fail the test
|
||||||
|
uri:
|
||||||
|
url: "https://0.0.0.0:9200/_cat/indices"
|
||||||
|
user: "admin"
|
||||||
|
password: "admin"
|
||||||
|
force_basic_auth: true
|
||||||
|
method: GET
|
||||||
|
validate_certs: false
|
||||||
|
status_code: "200"
|
||||||
|
return_content: true
|
||||||
|
register: _opensearch_indices
|
||||||
|
until: "'logstash-logscraper' in _opensearch_indices.content"
|
||||||
|
retries: 3
|
||||||
|
delay: 10
|
||||||
|
|||||||
@@ -142,6 +142,13 @@
|
|||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
### service validation ###
|
### service validation ###
|
||||||
|
- name: Check if log gearman client is listening
|
||||||
|
wait_for:
|
||||||
|
host: "{{ gearman_host }}"
|
||||||
|
port: "{{ gearman_port }}"
|
||||||
|
delay: 10
|
||||||
|
timeout: 300
|
||||||
|
|
||||||
- name: Ensure that all services are available and running
|
- name: Ensure that all services are available and running
|
||||||
shell: |
|
shell: |
|
||||||
systemctl is-active -q {{ item }}
|
systemctl is-active -q {{ item }}
|
||||||
@@ -152,24 +159,55 @@
|
|||||||
register: _service_status
|
register: _service_status
|
||||||
failed_when: _service_status.rc != 0
|
failed_when: _service_status.rc != 0
|
||||||
|
|
||||||
- name: Check if log gearman client is listening
|
|
||||||
wait_for:
|
|
||||||
host: "{{ gearman_host }}"
|
|
||||||
port: "{{ gearman_port }}"
|
|
||||||
delay: 10
|
|
||||||
timeout: 300
|
|
||||||
|
|
||||||
- name: Get Opensearch indices
|
- name: Get Opensearch indices
|
||||||
uri:
|
block:
|
||||||
url: "https://localhost:9200/_cat/indices"
|
- name: Get indices
|
||||||
user: "admin"
|
uri:
|
||||||
password: "admin"
|
url: "https://0.0.0.0:9200/_cat/indices"
|
||||||
force_basic_auth: true
|
user: "admin"
|
||||||
method: GET
|
password: "admin"
|
||||||
validate_certs: false
|
force_basic_auth: true
|
||||||
status_code: "200"
|
method: GET
|
||||||
return_content: true
|
validate_certs: false
|
||||||
register: _opensearch_indices
|
status_code: "200"
|
||||||
until: "'logstash-logscraper' in _opensearch_indices.content"
|
return_content: true
|
||||||
retries: 30
|
register: _opensearch_indices
|
||||||
delay: 10
|
until: "'logstash-logscraper' in _opensearch_indices.content"
|
||||||
|
retries: 30
|
||||||
|
delay: 10
|
||||||
|
|
||||||
|
rescue:
|
||||||
|
- name: List all podman containers
|
||||||
|
shell: |
|
||||||
|
podman ps -a
|
||||||
|
|
||||||
|
- name: Get logstash logs
|
||||||
|
shell: |
|
||||||
|
podman logs logstash
|
||||||
|
|
||||||
|
- name: Get opensearch logs
|
||||||
|
shell: |
|
||||||
|
podman logs opensearch
|
||||||
|
|
||||||
|
- name: Get gearman client logs
|
||||||
|
shell: |
|
||||||
|
podman logs loggearman-client
|
||||||
|
|
||||||
|
- name: Get gearman worker logs
|
||||||
|
shell: |
|
||||||
|
podman logs loggearman-worker
|
||||||
|
|
||||||
|
- name: Get indices to fail the test
|
||||||
|
uri:
|
||||||
|
url: "https://0.0.0.0:9200/_cat/indices"
|
||||||
|
user: "admin"
|
||||||
|
password: "admin"
|
||||||
|
force_basic_auth: true
|
||||||
|
method: GET
|
||||||
|
validate_certs: false
|
||||||
|
status_code: "200"
|
||||||
|
return_content: true
|
||||||
|
register: _opensearch_indices
|
||||||
|
until: "'logstash-logscraper' in _opensearch_indices.content"
|
||||||
|
retries: 3
|
||||||
|
delay: 10
|
||||||
|
|||||||
Reference in New Issue
Block a user