ansible / ansible.builtin / v2.9.13 / module / cloudscale_volume Manages volumes on the cloudscale.ch IaaS service. | "added in version" 2.8 of ansible.builtin" Authors: Gaudenz Steinlin (@gaudenz), René Moser (@resmo) preview | supported by communityansible.builtin.cloudscale_volume (v2.9.13) — module
pip
Install with pip install ansible==2.9.13
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 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
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 version_added: '2.9' version_added_collection: ansible.builtin 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 state: choices: - present - absent default: present description: - State of the volume. type: str api_url: default: https://api.cloudscale.ch/v1 description: - cloudscale.ch API URL. - This can also be passed in the C(CLOUDSCALE_API_URL) environment variable. type: str version_added: 1.3.0 version_added_collection: cloudscale_ch.cloud 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. required: true type: str api_timeout: default: 45 description: - Timeout in seconds for calls to the cloudscale.ch API. - This can also be passed in the C(CLOUDSCALE_API_TIMEOUT) environment variable. 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: ansible.builtin 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