File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ - name : " Get the observability strategy"
3+ ansible.builtin.shell :
4+ cmd : |
5+ oc get stf default -ojsonpath='{.spec.observabilityStrategy}'
6+ changed_when : false
7+ register : observability_strategy
8+
9+ - name : " Set the observability api based on the observability strategy"
10+ ansible.builtin.set_fact :
11+ observability_api : " {{ 'monitoring.rhobs' if observability_strategy.stdout == 'use_redhat' else 'monitoring.coreos.com' }}"
12+
Original file line number Diff line number Diff line change 66 vars :
77 prom_auth_method : token
88
9+ - name : " Get the observability strategy and set the observability_api"
10+ ansible.builtin.include_tasks :
11+ file : get_observability_api.yml
12+
913- name : " Test Creating an alert rule in Prometheus"
1014 ansible.builtin.include_tasks :
1115 file : test_create_an_alert.yml
Original file line number Diff line number Diff line change 77 ansible.builtin.shell :
88 cmd : |
99 oc apply -f - <<EOF
10- apiVersion: monitoring.coreos.com /v1
10+ apiVersion: {{ observability_api }} /v1
1111 kind: PrometheusRule
1212 metadata:
1313 creationTimestamp: null
Original file line number Diff line number Diff line change 11---
22# tasks file for roles/test_verify_email
3+ - name : " Get the observability strategy and set observability_api"
4+ ansible.builtin.include_role :
5+ name : test_alerts
6+ tasks_from : get_observability_api.yml
37
48- name : " RHELOSP-176042 Create the alert"
59 ansible.builtin.shell :
610 cmd : |
711 oc apply -f - <<EOF
8- apiVersion: monitoring.coreos.com /v1
12+ apiVersion: {{ observability_api }} /v1
913 kind: PrometheusRule
1014 metadata:
1115 creationTimestamp: null
You can’t perform that action at this time.
0 commit comments