2023-03-03 09:53:02 +01:00
|
|
|
---
|
2022-08-23 15:42:32 +02:00
|
|
|
- name: Create a Grafana Cloud stack
|
|
|
|
grafana.grafana.cloud_stack:
|
2023-02-08 10:35:28 +01:00
|
|
|
name: "{{ test_stack_name }}"
|
|
|
|
stack_slug: "{{ test_stack_name }}"
|
2022-08-23 15:42:32 +02:00
|
|
|
cloud_api_key: "{{ grafana_cloud_api_key }}"
|
|
|
|
org_slug: "{{ org_name }}"
|
|
|
|
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:
|
2023-02-08 10:35:28 +01:00
|
|
|
- create_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"
|
2022-08-23 15:42:32 +02:00
|
|
|
|
|
|
|
- name: Sleep for 30 seconds
|
|
|
|
ansible.builtin.wait_for:
|
|
|
|
timeout: 30
|
|
|
|
|
|
|
|
- name: Delete a Grafana Cloud stack
|
|
|
|
grafana.grafana.cloud_stack:
|
2023-02-08 10:35:28 +01:00
|
|
|
name: "{{ test_stack_name }}"
|
|
|
|
stack_slug: "{{ test_stack_name }}"
|
2022-08-23 15:42:32 +02:00
|
|
|
cloud_api_key: "{{ grafana_cloud_api_key }}"
|
|
|
|
org_slug: "{{ org_name }}"
|
|
|
|
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:
|
|
|
|
- delete_result.changed == true
|
2023-02-08 10:35:28 +01:00
|
|
|
- delete_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"
|