Skip to content

Commit b3535eb

Browse files
committed
add format consistency to tasks yamls files
1 parent 6e2c750 commit b3535eb

File tree

5 files changed

+30
-29
lines changed

5 files changed

+30
-29
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
2-
- name: "Set variables dynamically {{ item }}"
2+
- name: Set variables dynamically "{{ item }}"
33
ansible.builtin.set_fact:
44
cloudkitty_data_file: "{{ artifacts_dir_zuul }}/{{ item }}{{ cloudkitty_synth_data_suffix }}"
55
cloudkitty_synth_totals_file: "{{ artifacts_dir_zuul }}/{{ item }}{{ cloudkitty_synth_totals_metrics_suffix }}"
66
cloudkitty_test_file: "{{ cloudkitty_scenario_dir }}/{{ item }}.yml"
77

8-
- name: "Check for preexisting output file"
8+
- name: Check for preexisting output file
99
ansible.builtin.stat:
1010
path: "{{ cloudkitty_data_file }}"
1111
register: file_preexists
1212

13-
- name: "Generate Synthetic Data {{ item }}"
13+
- name: Generate Synthetic Data "{{ item }}"
1414
ansible.builtin.command:
1515
cmd: >
1616
python3 "{{ cloudkitty_synth_script }}"
1717
-r
1818
--tmpl "{{ cloudkitty_data_template }}"
1919
-t "{{ cloudkitty_test_file }}"
2020
-o "{{ cloudkitty_data_file }}"
21-
{% if cloudkitty_project_id | default('') %} -p "{{ cloudkitty_project_id }}"{% endif %}
21+
{% if cloudkitty_project_id is defined and cloudkitty_project_id %} -p "{{ cloudkitty_project_id }}"{% endif %}
2222
register: script_output
2323
when: not file_preexists.stat.exists | bool
2424
changed_when: script_output.rc == 0
2525

26-
- name: "Generate chargeback rating from synthetic data file {{ item }}"
26+
- name: Generate chargeback rating from synthetic data file "{{ item }}"
2727
ansible.builtin.command:
2828
cmd: >
2929
python3 "{{ cloudkitty_summary_script }}"
@@ -34,7 +34,7 @@
3434
when: not file_preexists.stat.exists | bool
3535
changed_when: synth_rating_info.rc == 0
3636

37-
- name: "Load metrics from YAML file"
37+
- name: Load metrics from YAML file
3838
ansible.builtin.include_vars:
3939
file: "{{ cloudkitty_synth_totals_file }}"
4040
name: synth_data_rates
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
2-
- name: "Ingests Cloudkitty Data log: {{ item }}"
2+
- name: Ingests Cloudkitty Data log "{{ item }}"
33
ansible.builtin.include_tasks:
44
file: ingest_loki_data.yml
55

6-
- name: "Flush Data to loki Storage: {{ item }}"
6+
- name: Flush Data to loki Storage " {{ item }}"
77
ansible.builtin.include_tasks:
88
file: flush_loki_data.yml
99

10-
- name: "Retrieve Data log from loki: {{ item }}"
10+
- name: Retrieve Data log from loki "{{ item }}"
1111
ansible.builtin.include_tasks:
1212
file: retrieve_loki_data.yml

roles/telemetry_chargeback/tasks/main.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
cloudkitty_debug_dir: ""
1616
when: not cloudkitty_debug | bool
1717

18-
- name: Get admin project ID for CI
18+
- name: "Get admin project ID for CI"
1919
ansible.builtin.command:
2020
cmd: "{{ openstack_cmd }} project show admin -f value -c id"
2121
register: get_admin_project_id
2222
changed_when: false
2323
failed_when: false
2424

25-
- name: Set admin project ID for CI
25+
- name: "Set admin project ID for CI"
2626
ansible.builtin.set_fact:
2727
cloudkitty_project_id: "{{ (get_admin_project_id.stdout | trim) | default('') }}"
2828

29-
- name: Get admin user ID for CI
29+
- name: "Get admin user ID for CI"
3030
ansible.builtin.command:
3131
cmd: "{{ openstack_cmd }} user show admin -f value -c id"
3232
register: get_admin_user_id
3333
changed_when: false
3434
failed_when: false
3535

36-
- name: Set admin user ID for CI
36+
- name: "Set admin user ID for CI"
3737
ansible.builtin.set_fact:
3838
cloudkitty_user_id: "{{ (get_admin_user_id.stdout | trim) | default('') }}"
3939

roles/telemetry_chargeback/tasks/retrieve_loki_data.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Query Loki
77
- name: "Retrieve Logs from Loki via API {{ item }}"
88
block:
9-
- name: Query Loki API
9+
- name: "Query Loki API"
1010
ansible.builtin.uri:
1111
url: "{{ loki_query_url }}?query={{ logql_query | urlencode }}&start={{ synth_data_rates.time.begin_step.nanosec }}&limit={{ limit }}"
1212
method: GET
@@ -26,7 +26,7 @@
2626
retries: 25
2727
delay: 60
2828

29-
- name: Save Loki Data to JSON file
29+
- name: "Save Loki Data to JSON file"
3030
ansible.builtin.copy:
3131
content: "{{ loki_response.json | to_json }}"
3232
dest: "{{ artifacts_dir_zuul }}/{{ item }}{{ cloudkitty_loki_data_suffix }}"
@@ -48,15 +48,15 @@
4848
success_msg: "Query returned all data entries. Input file had {{ synth_data_rates.data_log.log_count }} entries and Loki returned {{ actual_count }}"
4949

5050
rescue:
51-
- name: Debug failure
51+
- name: "Debug failure"
5252
ansible.builtin.debug:
5353
msg:
5454
- "Status: {{ loki_response.status | default('Unknown') }}"
5555
- "Body: {{ loki_response.content | default('No Content') }}"
5656
- "Msg: {{ loki_response.msg | default('Request failed') }}"
5757

5858
# Failure
59-
- name: Report Retrieval Failure
59+
- name: "Report Retrieval Failure"
6060
ansible.builtin.fail:
6161
msg: "Retrieval Failed"
6262

roles/telemetry_chargeback/tasks/setup_loki_env.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
# Setup Loki Environment
33

44
# Dynamic URL's
5-
- name: Get Loki Public Route Host
5+
- name: "Get Loki Public Route Host"
66
ansible.builtin.command:
77
cmd: oc get route cloudkitty-lokistack -n {{ cloudkitty_namespace }} -o jsonpath='{.spec.host}'
88
register: loki_route
99
changed_when: false
1010

11-
- name: Set Loki URLs
11+
- name: "Set Loki URLs"
1212
ansible.builtin.set_fact:
1313
# Base URL
1414
loki_base_url: "https://{{ loki_route.stdout }}"
1515

1616
# Internal Flush URL (Service DNS: https://<service>.<namespace>.svc:3100/flush)
1717
ingester_flush_url: "https://cloudkitty-lokistack-ingester-http.{{ cloudkitty_namespace }}.svc:3100/flush"
1818

19-
- name: Set Derived Loki URLs
19+
- name: "Set Derived Loki URLs"
2020
ansible.builtin.set_fact:
2121
loki_push_url: "{{ loki_base_url }}/api/logs/v1/cloudkitty/loki/api/v1/push"
2222
loki_query_url: "{{ loki_base_url }}/api/logs/v1/cloudkitty/loki/api/v1/query_range"
2323

24-
- name: Debug URLs
24+
- name: "Debug URLs"
2525
ansible.builtin.debug:
2626
msg:
2727
- "Loki Route: {{ loki_base_url }}"
@@ -30,13 +30,13 @@
3030
- "Query URL: {{ loki_query_url }}"
3131

3232
# Certs to Ingest & Retrieve data to/from Loki
33-
- name: Ensure Local Certificate Directory Exists
33+
- name: "Ensure Local Certificate Directory Exists"
3434
ansible.builtin.file:
3535
path: "{{ cert_dir }}"
3636
state: directory
3737
mode: '0755'
3838

39-
- name: Extract Certificates from Openshift Secret
39+
- name: "Extract Certificates from Openshift Secret"
4040
ansible.builtin.command:
4141
cmd: >
4242
oc extract secret/{{ cert_secret_name }}
@@ -52,7 +52,7 @@
5252
# state: directory
5353
# mode: '0755'
5454

55-
- name: Extract Client Certificates
55+
- name: "Extract Client Certificates"
5656
ansible.builtin.command:
5757
cmd: >
5858
oc extract {{ client_secret }}
@@ -61,10 +61,11 @@
6161
-n {{ cloudkitty_namespace }}
6262
changed_when: true
6363

64-
- name: Extract CA Bundle
64+
- name: "Extract CA Bundle"
6565
ansible.builtin.command:
66-
cmd: "oc extract {{ ca_configmap }}
67-
--to={{ local_cert_dir }}
68-
--confirm
69-
-n {{ cloudkitty_namespace }}"
66+
cmd: >
67+
oc extract {{ ca_configmap }}
68+
--to={{ local_cert_dir }}
69+
--confirm
70+
-n {{ cloudkitty_namespace }}"
7071
changed_when: true

0 commit comments

Comments
 (0)