cloudscale_volume – Manages volumes on the cloudscale.ch IaaS service¶
New in version 2.8.
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.
- Instead of the api_token parameter the CLOUDSCALE_API_TOKENenvironment variable can be used.
- 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_volume:
    name: my_ssd_volume
    size_gb: 50
    api_token: xxxxxx
  register: my_ssd_volume
# Attach an existing volume to a server
- name: Attach volume to server
  cloudscale_volume:
    uuid: my_ssd_volume.uuid
    server_uuids:
      - ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
    api_token: xxxxxx
# Create and attach a volume to a server
- name: Create and attach volume to server
  cloudscale_volume:
    name: my_ssd_volume
    size_gb: 50
    server_uuids:
      - ea3b39a3-77a8-4d0b-881d-0bb00a1e7f48
    api_token: xxxxxx
# Detach volume from server
- name: Detach volume from server
  cloudscale_volume:
    uuid: my_ssd_volume.uuid
    server_uuids: []
    api_token: xxxxxx
# Delete a volume
- name: Delete volume
  cloudscale_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:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Gaudenz Steinlin (@gaudenz)
- René Moser (@resmo)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
