2023-03-03 09:53:02 +01:00
|
|
|
---
|
2022-08-23 15:42:32 +02:00
|
|
|
- name: Create/Update a Folder in Grafana
|
|
|
|
grafana.grafana.folder:
|
|
|
|
title: Ansible Integration test
|
|
|
|
uid: test123
|
|
|
|
overwrite: true
|
|
|
|
stack_slug: "{{ stack_name }}"
|
|
|
|
grafana_api_key: "{{ grafana_api_key }}"
|
|
|
|
state: present
|
|
|
|
register: create_result
|
|
|
|
|
2023-03-03 09:53:02 +01:00
|
|
|
- name: Create Check
|
|
|
|
ansible.builtin.assert:
|
2022-08-23 15:42:32 +02:00
|
|
|
that:
|
2022-11-01 08:22:19 +01:00
|
|
|
- create_result.failed == false
|
2022-08-23 15:42:32 +02:00
|
|
|
|
|
|
|
- name: Delete a folder
|
|
|
|
grafana.grafana.folder:
|
|
|
|
title: Ansible Integration test
|
|
|
|
uid: test123
|
|
|
|
overwrite: true
|
|
|
|
stack_slug: "{{ stack_name }}"
|
|
|
|
grafana_api_key: "{{ grafana_api_key }}"
|
|
|
|
state: absent
|
|
|
|
register: delete_result
|
|
|
|
|
2023-03-03 09:53:02 +01:00
|
|
|
- name: Delete Check
|
|
|
|
ansible.builtin.assert:
|
2022-08-23 15:42:32 +02:00
|
|
|
that:
|
2023-02-08 10:35:28 +01:00
|
|
|
- delete_result.output.status == 200
|
2023-03-03 09:53:02 +01:00
|
|
|
- delete_result.output.response == "Folder has been successfully deleted"
|