2023-03-03 09:53:02 +01:00
|
|
|
---
|
2022-08-23 15:42:32 +02:00
|
|
|
- name: Create/Update a dashboard
|
|
|
|
grafana.grafana.dashboard:
|
2023-03-03 09:53:02 +01:00
|
|
|
dashboard:
|
|
|
|
dashboard:
|
|
|
|
uid: test1234
|
|
|
|
title: Ansible Integration Test
|
|
|
|
tags:
|
|
|
|
- templated
|
|
|
|
timezone: browser
|
|
|
|
schemaVersion: 16
|
|
|
|
refresh: 25s
|
|
|
|
version: 0
|
|
|
|
overwrite: true
|
2022-08-23 15:42:32 +02:00
|
|
|
stack_slug: "{{ stack_name }}"
|
|
|
|
grafana_api_key: "{{ grafana_api_key }}"
|
|
|
|
state: present
|
|
|
|
register: result_present
|
|
|
|
|
2023-03-03 09:53:02 +01:00
|
|
|
- name: Create/Update Check
|
|
|
|
ansible.builtin.assert:
|
2022-08-23 15:42:32 +02:00
|
|
|
that:
|
|
|
|
- result_present.changed == true
|
|
|
|
- result_present.output.status == "success"
|
|
|
|
|
|
|
|
- name: Delete dashboard
|
|
|
|
grafana.grafana.dashboard:
|
2023-03-03 09:53:02 +01:00
|
|
|
dashboard:
|
|
|
|
dashboard:
|
|
|
|
uid: test1234
|
|
|
|
title: Ansible Integration Test
|
|
|
|
tags:
|
|
|
|
- templated
|
|
|
|
timezone: browser
|
|
|
|
schemaVersion: 16
|
|
|
|
version: 0
|
|
|
|
refresh: 25s
|
|
|
|
overwrite: true
|
2022-08-23 15:42:32 +02:00
|
|
|
stack_slug: "{{ stack_name }}"
|
|
|
|
grafana_api_key: "{{ grafana_api_key }}"
|
|
|
|
state: absent
|
|
|
|
register: result_absent
|
|
|
|
|
2023-03-03 09:53:02 +01:00
|
|
|
- name: Delete Check
|
|
|
|
ansible.builtin.assert:
|
2022-08-23 15:42:32 +02:00
|
|
|
that:
|
|
|
|
- result_absent.changed == true
|
2023-03-03 09:53:02 +01:00
|
|
|
- result_absent.output.message == "Dashboard Ansible Integration Test deleted"
|