Skip to content

Commit 0e9b11c

Browse files
authored
Add new pre-checks for services for OSP18 (#129)
Add new pre-checks for services for OSP18 Update ansible tasks to check required services are available OSPRH-6724
1 parent 817fa3e commit 0e9b11c

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

roles/telemetry_autoscaling/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
include_vars: "{{ item }}"
1111
with_items: "{{ vars_files }}"
1212

13+
- name: RHOSO-12666 Test services are enabled for autoscaling
14+
when: metrics_backend == "prometheus"
15+
ansible.builtin.include_tasks:
16+
file: test_services.yml
17+
tags: precheck
18+
1319
- name: Check pre-reqs for autoscaling
1420
ansible.builtin.include_tasks:
1521
file: verify_autoscaling.yml
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
# Verify Orchestration (heat) and telemetry services resources are ready for autoscaling
3+
4+
- name: Verify that custom resource HEAT is ready
5+
ansible.builtin.command:
6+
cmd: |
7+
oc get heat heat -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}'
8+
register: result
9+
failed_when:
10+
- result.stdout != "True"
11+
12+
- name: Verify that custom resource CEILOMETER is ready
13+
ansible.builtin.command:
14+
cmd: |
15+
oc get ceilometer ceilometer -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}'
16+
register: result
17+
failed_when:
18+
- result.stdout != "True"
19+
20+
# - name: Verify that custom resource AUTOSCALING is ready
21+
# It is returning an unexpected response and needs further debugging. will raise another PR to inspect this
22+
# ansible.builtin.command:
23+
# cmd: |
24+
# oc get autoscaling autoscaling -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}'
25+
# register: result
26+
# failed_when:
27+
# - result.stdout != "True"
28+
29+
- name: Verify that custom resource METRICSTORAGE is ready
30+
ansible.builtin.command:
31+
cmd: |
32+
oc get metricstorage metric-storage -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}{"\n"}'
33+
register: result
34+
failed_when:
35+
- result.stdout != "True"

roles/telemetry_autoscaling/tasks/verify_autoscaling.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@
4040
{{ openstack_cmd }} metric status --fit-width;
4141
register: result
4242
failed_when: result.rc >= 1
43+
44+
# This works when using prometheus as the metrics backend
45+
- name: Verify that PROMETHEUS is enabled
46+
when: metrics_backend == "prometheus"
47+
ansible.builtin.shell: |
48+
{{ openstack_cmd }} metric query up --disable-rbac -c container -c value |grep -i "prometheus" |awk '{print $4}'
49+
register: result
50+
failed_when:
51+
- result.stdout != "0"

0 commit comments

Comments
 (0)