1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/cloudscale_common/tasks/cleanup_server_groups.yml

17 lines
505 B
YAML

---
- name: List all server groups
uri:
url: 'https://api.cloudscale.ch/v1/server-groups'
headers:
Authorization: 'Bearer {{ cloudscale_api_token }}'
status_code: 200
register: server_group_list
- name: Remove all server groups created by this test run
cloudscale_server_group:
uuid: '{{ item.uuid }}'
state: absent
when: cloudscale_resource_prefix in item.name
with_items: '{{ server_group_list.json }}'
loop_control:
label: '{{ item.name }} ({{ item.uuid }})'