grafana-ansible-collection/tests/integration/targets/cloud_stack/tasks/main.yml
2023-03-03 14:23:02 +05:30

34 lines
932 B
YAML

---
- name: Create a Grafana Cloud stack
grafana.grafana.cloud_stack:
name: "{{ test_stack_name }}"
stack_slug: "{{ test_stack_name }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
org_slug: "{{ org_name }}"
state: present
register: create_result
- name: Create Check
ansible.builtin.assert:
that:
- create_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"
- name: Sleep for 30 seconds
ansible.builtin.wait_for:
timeout: 30
- name: Delete a Grafana Cloud stack
grafana.grafana.cloud_stack:
name: "{{ test_stack_name }}"
stack_slug: "{{ test_stack_name }}"
cloud_api_key: "{{ grafana_cloud_api_key }}"
org_slug: "{{ org_name }}"
state: absent
register: delete_result
- name: Delete Check
ansible.builtin.assert:
that:
- delete_result.changed == true
- delete_result.url == "https://" + "{{ test_stack_name }}" + ".grafana.net"