community / community.general / 0.1.1 / module / cloudscale_volume Manages volumes on the cloudscale.ch IaaS service. Authors: Gaudenz Steinlin (@gaudenz), René Moser (@resmo), Denis Krienbühl (@href) preview | supported by communitycommunity.general.cloudscale_volume (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
Create, attach/detach, update and delete volumes on the cloudscale.ch IaaS service.
# Create a new SSD volume - name: Create an SSD volume cloudscale_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_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 zone: 'lpg1' 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
name: description: - Name of the volume. Either name or UUID must be present to change an existing volume. type: str tags: description: - Tags associated with the volume. Set this to C({}) to clear any tags. type: dict type: choices: - ssd - bulk description: - Type of the volume. Cannot be changed after creating the volume. Defaults to C(ssd) on volume creation. type: str uuid: description: - UUID of the volume. Either name or UUID must be present to change an existing volume. type: str zone: description: - Zone in which the volume resides (e.g. C(lgp1) or C(rma1)). Cannot be changed after creating the volume. Defaults to the project default zone. type: str state: choices: - present - absent default: present description: - State of the volume. type: str size_gb: description: - Size of the volume in GB. type: int api_token: description: - cloudscale.ch API token. - This can also be passed in the C(CLOUDSCALE_API_TOKEN) environment variable. type: str api_timeout: default: 30 description: - Timeout in seconds for calls to the cloudscale.ch API. type: int server_uuids: aliases: - server_uuid description: - UUIDs of the servers this volume is attached to. Set this to C([]) to detach the volume. Currently a volume can only be attached to a single server. type: list
href: description: The API URL to get details about this volume. returned: state == present sample: https://api.cloudscale.ch/v1/volumes/2db69ba3-1864-4608-853a-0771b6885a3a type: str name: description: The display name of the volume. returned: state == present sample: my_ssd_volume type: str server_uuids: description: The UUIDs of the servers this volume is attached to. returned: state == present sample: - 47cec963-fcd2-482f-bdb6-24461b2d47b1 type: list size_gb: description: The size of the volume in GB. returned: state == present sample: 50 type: str state: description: The current status of the volume. returned: success sample: present type: str tags: description: Tags associated with the volume. returned: state == present sample: project: my project type: dict version_added: '2.9' version_added_collection: community.general type: description: The type of the volume. returned: state == present sample: bulk type: str uuid: description: The unique identifier for this volume. returned: state == present sample: 2db69ba3-1864-4608-853a-0771b6885a3a type: str zone: description: The zone of the volume. returned: state == present sample: slug: lpg1 type: dict version_added: '2.10' version_added_collection: community.general