Initial commit

This commit is contained in:
Ansible Core Team 2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View file

@ -0,0 +1,17 @@
---
- name: List all floating IPs
uri:
url: 'https://api.cloudscale.ch/v1/floating-ips'
headers:
Authorization: 'Bearer {{ cloudscale_api_token }}'
status_code: 200
register: floating_ip_list
- name: Remove all floating IPs created by this test run
cloudscale_floating_ip:
ip: '{{ item.network | ipaddr("address") }}'
state: 'absent'
when: cloudscale_resource_prefix in (item.reverse_ptr | string )
with_items: '{{ floating_ip_list.json }}'
loop_control:
label: '{{ item.reverse_ptr }} ({{ item.network }})'

View file

@ -0,0 +1,17 @@
---
- 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 }})'

View file

@ -0,0 +1,17 @@
---
- name: List all servers
uri:
url: 'https://api.cloudscale.ch/v1/servers'
headers:
Authorization: 'Bearer {{ cloudscale_api_token }}'
status_code: 200
register: server_list
- name: Remove all servers created by this test run
cloudscale_server:
uuid: '{{ item.uuid }}'
state: 'absent'
when: cloudscale_resource_prefix in item.name
with_items: '{{ server_list.json }}'
loop_control:
label: '{{ item.name }} ({{ item.uuid }})'

View file

@ -0,0 +1,17 @@
---
- name: List all volumes
uri:
url: 'https://api.cloudscale.ch/v1/volumes'
headers:
Authorization: 'Bearer {{ cloudscale_api_token }}'
status_code: 200
register: volume_list
- name: Remove all volumes created by this test run
cloudscale_volume:
uuid: '{{ item.uuid }}'
state: 'absent'
when: cloudscale_resource_prefix in item.name
with_items: '{{ volume_list.json }}'
loop_control:
label: '{{ item.name }} ({{ item.uuid }})'

View file

@ -0,0 +1,6 @@
---
# Password to use for test server
# This has to be set as a fact, otherwise a new password will be generated
# on every variable access.
- set_fact:
cloudscale_test_password: "{{ lookup('password', '/dev/null length=15 chars=ascii_letters') }}"