Skip to content

Commit 5cc8fac

Browse files
authored
Merge pull request #392 from infrawatch/alexy_ck_job_6b
[telemetry_chargeback] Update ingest data yaml based on feedback
2 parents 1936df5 + 328700b commit 5cc8fac

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
11
---
22
# Ingest data generated by gen_synth_loki_data.yml to Loki
33

4-
- name: "Ingest data log to Loki via API"
4+
- name: "TEST Push data to Loki {{ scenario_name }}"
55
block:
6-
7-
- name: "Push data to Loki"
6+
- name: "POST data to Loki"
87
ansible.builtin.uri:
9-
## loki_push_url will be used in future role developement
8+
# loki_push_url is configured in setup_loki_env.yml
109
url: "{{ loki_push_url }}"
1110
method: POST
1211
src: "{{ cloudkitty_data_file }}"
1312
body_format: json
1413
client_cert: "{{ cert_dir }}/tls.crt"
1514
client_key: "{{ cert_dir }}/tls.key"
15+
# Note: ca_path not required with validate_certs: false, but included for consistency with retrieve_loki_data.yml
16+
ca_path: "{{ cert_dir }}/ca.crt"
1617
validate_certs: false
1718
status_code: 204
1819
return_content: true
1920
register: loki_response
20-
ignore_errors: false
21-
failed_when: loki_response.status != 204
2221

23-
# Success
24-
- name: "Confirm ingestion success"
22+
- name: "Ingest Status Message"
2523
ansible.builtin.debug:
26-
msg: "Ingestion Successful!"
24+
msg: "Ingestion Successful for {{ scenario_name }}"
2725

2826
rescue:
29-
# Rescue block
30-
- name: "Debug failure"
31-
ansible.builtin.debug:
32-
msg: "Ingest failed. Loki Status: {{ loki_response.status | default('N/A') }}"
27+
- name: "IngestionFailed"
28+
ansible.builtin.fail:
29+
msg:
30+
- "Scenario: {{ scenario_name }}"
31+
- "Status: {{ loki_response.status | default('Unknown') }}"
32+
- "Body: {{ loki_response.content | default('No Content') }}"
33+
- "Message: {{ loki_response.msg | default('Request failed') }}"

0 commit comments

Comments
 (0)