grafana-ansible-collection/tests/integration/targets/dashboard/tasks/main.yml

47 lines
1.2 KiB
YAML
Raw Normal View History

- name: Create/Update a dashboard
grafana.grafana.dashboard:
dashboard: {
"dashboard": {
"uid": test1234,
"title": "Ansible Integration Test",
"tags": [ "templated" ],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "25s"
},
"overwrite": true
}
stack_slug: "{{ stack_name }}"
grafana_api_key: "{{ grafana_api_key }}"
state: present
register: result_present
- assert:
that:
- result_present.changed == true
- result_present.output.status == "success"
- name: Delete dashboard
grafana.grafana.dashboard:
dashboard: {
"dashboard": {
"uid": test1234,
"title": "Ansible Integration Test",
"tags": [ "templated" ],
"timezone": "browser",
"schemaVersion": 16,
"version": 0,
"refresh": "25s"
},
"overwrite": true
}
stack_slug: "{{ stack_name }}"
grafana_api_key: "{{ grafana_api_key }}"
state: absent
register: result_absent
- assert:
that:
- result_absent.changed == true
- result_absent.output.message == "Dashboard Ansible Integration Test deleted"