ansible/test/integration/targets/cloudscale_volume/tasks/check-mode.yml
Gaudenz Steinlin 35f17bf4c2 Cloudscale volume (#49887)
* Cloudscale integration test setup

CloudProvider and CloudEnvironment classes for Cloudscale integration
tests. This also contains a cloudscale_common role with common
variables for all tests.

* cloudscale_volume module

New cloud module to manage volumes on the cloudscale.ch IaaS service.
2019-01-07 22:29:01 +01:00

62 lines
1.8 KiB
YAML

---
- name: Create volume in check mode
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-check-mode'
size_gb: 50
register: check_mode_vol
check_mode: True
- name: Delete volume created in check mode
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-check-mode'
state: 'absent'
register: check_mode_delete
- name: 'VERIFY: Create volume in check mode'
assert:
that:
- check_mode_vol is successful
- check_mode_vol is changed
- check_mode_delete is successful
- check_mode_delete is not changed
- name: Create volume
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-vol'
size_gb: 50
- name: Attach volume in check mode
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-vol'
server_uuids:
- '{{ server.uuid }}'
check_mode: True
register: check_mode_attach
- name: Detach volume
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-vol'
server_uuids: []
register: check_mode_detach
- name: 'VERIFY: Attach volume in check mode'
assert:
that:
- check_mode_attach is successful
- check_mode_attach is changed
- check_mode_detach is successful
- check_mode_detach is not changed
- name: Resize volume in check mode
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-vol'
size_gb: 100
register: check_mode_resize
check_mode: True
- name: Get volume info
cloudscale_volume:
name: '{{ cloudscale_resource_prefix }}-vol'
register: check_mode_info
- name: 'VERIFY: Resize volume in check mode'
assert:
that:
- check_mode_resize is successful
- check_mode_resize is changed
- check_mode_info is successful
- check_mode_info is not changed
- check_mode_info.size_gb == 50