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 @@
hidden

View file

@ -0,0 +1,19 @@
---
# The image to use for test servers
cloudscale_test_image: 'debian-9'
# Alternate test image to use if a different image is required
cloudscale_alt_test_image: 'ubuntu-18.04'
# The flavor to use for test servers
cloudscale_test_flavor: 'flex-2'
# SSH key to use for test servers
cloudscale_test_ssh_key: |
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDSPmiqkvDH1/+MDAVDZT8381aYqp73Odz8cnD5hegNhqtXajqtiH0umVg7HybX3wt1HjcrwKJovZURcIbbcDvzdH2bnYbF93T4OLXA0bIfuIp6M86x1iutFtXdpN3TTicINrmSXEE2Ydm51iMu77B08ZERjVaToya2F7vC+egfoPvibf7OLxE336a5tPCywavvNihQjL8sjgpDT5AAScjb3YqK/6VLeQ18Ggt8/ufINsYkb+9/Ji/3OcGFeflnDXq80vPUyF3u4iIylob6RSZenC38cXmQB05tRNxS1B6BXCjMRdy0v4pa7oKM2GA4ADKpNrr0RI9ed+peRFwmsclH test@ansible
# The zone to use to test servers
cloudscale_test_zone: 'lpg1'
# The region to use to request floating IPs
cloudscale_test_region: 'lpg'

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') }}"