-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
68 additions
and
69 deletions.
There are no files selected for viewing
137 changes: 68 additions & 69 deletions
137
tests/integration/targets/grafana_datasource/tasks/quickwit.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,138 +1,137 @@ | ||
--- | ||
|
||
- name: Create Quickwit datasource | ||
register: result | ||
grafana_datasource: | ||
name: "Quickwit" | ||
community.grafana.grafana_datasource: | ||
name: Quickwit | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
org_id: '1' | ||
org_id: "1" | ||
ds_type: quickwit-quickwit-datasource | ||
ds_url: http://localhost:7280/api/v1 | ||
additional_json_data: | ||
index: 'hdfs-logs' | ||
index: hdfs-logs | ||
timeField: timestamp | ||
timeOutputFormat: unix_timestamp_secs | ||
logMessageField: body | ||
logLevelField: severity_text | ||
|
||
- debug: | ||
- ansible.builtin.debug: | ||
var: result | ||
|
||
- assert: | ||
- ansible.builtin.assert: | ||
that: | ||
- result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://localhost:7280/api/v1' | ||
- "result.msg == 'Datasource Quickwit created'" | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_secs' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
- result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://localhost:7280/api/v1' | ||
- result.msg == 'Datasource Quickwit created' | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_secs' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
|
||
- name: Check Quickwit datasource creation (idempotency) | ||
register: result | ||
grafana_datasource: | ||
name: "Quickwit" | ||
community.grafana.grafana_datasource: | ||
name: Quickwit | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
org_id: '1' | ||
org_id: "1" | ||
ds_type: quickwit-quickwit-datasource | ||
ds_url: http://localhost:7280/api/v1 | ||
additional_json_data: | ||
index: 'hdfs-logs' | ||
index: hdfs-logs | ||
timeField: timestamp | ||
timeOutputFormat: unix_timestamp_secs | ||
logMessageField: body | ||
logLevelField: severity_text | ||
|
||
- debug: | ||
- ansible.builtin.debug: | ||
var: result | ||
|
||
- assert: | ||
- ansible.builtin.assert: | ||
that: | ||
- not result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://localhost:7280/api/v1' | ||
- "result.msg == 'Datasource Quickwit created'" | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_secs' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
- not result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://localhost:7280/api/v1' | ||
- result.msg == 'Datasource Quickwit created' | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_secs' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
|
||
- name: Update Quickwit datasource | ||
register: result | ||
grafana_datasource: | ||
name: "Quickwit" | ||
community.grafana.grafana_datasource: | ||
name: Quickwit | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
org_id: '1' | ||
org_id: "1" | ||
ds_type: quickwit-quickwit-datasource | ||
ds_url: http://quickwit-url:7280/api/v1 | ||
additional_json_data: | ||
index: 'hdfs-logs' | ||
index: hdfs-logs | ||
timeField: timestamp | ||
timeOutputFormat: unix_timestamp_millis | ||
logMessageField: body | ||
logLevelField: severity_text | ||
|
||
- debug: | ||
- ansible.builtin.debug: | ||
var: result | ||
|
||
- assert: | ||
- ansible.builtin.assert: | ||
that: | ||
- result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://quickwit-url:7280/api/v1' | ||
- "result.msg == 'Datasource Quickwit created'" | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_millis' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
- result.changed | ||
- result.datasource.access == 'proxy' | ||
- not result.datasource.isDefault | ||
- result.datasource.database == '' | ||
- result.datasource.name == 'Quickwit' | ||
- result.datasource.orgId == 1 | ||
- result.datasource.type == 'quickwit-quickwit-datasource' | ||
- result.datasource.url == 'http://quickwit-url:7280/api/v1' | ||
- result.msg == 'Datasource Quickwit created' | ||
- result.datasource.jsonData.index == 'hdfs-logs' | ||
- result.datasource.jsonData.timeField == 'timestamp' | ||
- result.datasource.jsonData.timeOutputFormat == 'unix_timestamp_millis' | ||
- result.datasource.jsonData.logMessageField == 'body' | ||
- result.datasource.jsonData.logLevelField == 'severity_text' | ||
|
||
- name: Delete Quickwit datasource | ||
register: result | ||
grafana_datasource: | ||
name: "Quickwit" | ||
community.grafana.grafana_datasource: | ||
name: Quickwit | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
state: absent | ||
|
||
- assert: | ||
- ansible.builtin.assert: | ||
that: | ||
- result.changed | ||
- result.changed | ||
|
||
- name: Delete Quickwit datasource (idempotency) | ||
register: result | ||
grafana_datasource: | ||
name: "Quickwit" | ||
community.grafana.grafana_datasource: | ||
name: Quickwit | ||
grafana_url: "{{ grafana_url }}" | ||
grafana_user: "{{ grafana_username }}" | ||
grafana_password: "{{ grafana_password }}" | ||
state: absent | ||
|
||
- assert: | ||
- ansible.builtin.assert: | ||
that: | ||
- not result.changed | ||
- not result.changed |