cloudscale_ch.cloud.volume – Manages volumes on the cloudscale.ch IaaS service.¶
Note
This plugin is part of the cloudscale_ch.cloud collection (version 2.1.0).
To install it use: ansible-galaxy collection install cloudscale_ch.cloud
.
To use it in a playbook, specify: cloudscale_ch.cloud.volume
.
New in version 1.0.0: of cloudscale_ch.cloud
Parameters¶
Notes¶
Note
To create a new volume at least the name and size_gb options are required.
A volume can be created and attached to a server in the same task.
All operations are performed using the cloudscale.ch public API v1.
For details consult the full API documentation: https://www.cloudscale.ch/en/api/v1.
A valid API token is required for all operations. You can create as many tokens as you like using the cloudscale.ch control panel at https://control.cloudscale.ch.
Examples¶
# Create a new SSD volume
- name: Create an SSD volume
cloudscale_ch.cloud.volume:
name: my_ssd_volume
zone: 'lpg1'
size_gb: 50
api_token: xxxxxx
register: my_ssd_volume
# Attach an existing volume to a server
- name: Attach volume to server
cloudscale_ch.cloud.volume:
uuid: "{{ my_ssd_volume.uuid }}"
servers:
- ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Create and attach a volume to a server
- name: Create and attach volume to server
cloudscale_ch.cloud.volume:
name: my_ssd_volume
zone: 'lpg1'
size_gb: 50
servers:
- ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
api_token: xxxxxx
# Detach volume from server
- name: Detach volume from server
cloudscale_ch.cloud.volume:
uuid: "{{ my_ssd_volume.uuid }}"
servers: []
api_token: xxxxxx
# Delete a volume
- name: Delete volume
cloudscale_ch.cloud.volume:
name: my_ssd_volume
state: absent
api_token: xxxxxx
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Authors¶
Gaudenz Steinlin (@gaudenz)
René Moser (@resmo)
Denis Krienbühl (@href)