# cloudscale_server_group – Manages server groups on the cloudscale.ch IaaS service

New in version 2.8.

- Synopsis

- Parameters

- Notes

- Examples

- Return Values

- Status

## Synopsis

- Create, update and remove server groups.

## Parameters

Parameter | Choices/Defaults | Comments
--- | --- | ---
api_timeout - | Default: 30 | Timeout in seconds for calls to the cloudscale.ch API.
api_token - |  | cloudscale.ch API token. This can also be passed in the `CLOUDSCALE_API_TOKEN` environment variable.
name string |  | Name of the server group. Either name or uuid is required. These options are mutually exclusive.

state
string

Choices:
- present ←
- absent

State of the server group.

tags dictionary added in 2.9 |  | Tags assosiated with the server groups. Set this to `{}` to clear any tags.
type string | Default: "anti-affinity" | Type of the server group.
uuid string |  | UUID of the server group. Either name or uuid is required. These options are mutually exclusive.

## Notes

Note

- Instead of the api_token parameter the `CLOUDSCALE_API_TOKEN` environment 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

    ---
    - name: Ensure server group exists
      cloudscale_server_group:
        name: my-name
        type: anti-affinity
        api_token: xxxxxx

    - name: Ensure a server group is absent
      cloudscale_server_group:
        name: my-name
        state: absent
        api_token: xxxxxx

## Return Values

Common return values are documented here, the following are the fields unique to this module:

Key | Returned | Description
--- | --- | ---
href string | if available | API URL to get details about this server group Sample: https://api.cloudscale.ch/v1/server-group/cfde831a-4e87-4a75-960f-89b0148aa2cc
name string | always | The display name of the server group Sample: load balancers
servers list | if available | A list of servers that are part of the server group.
state string | always | State of the server group. Sample: present
tags dictionary added in 2.9 | success | Tags assosiated with the server group. Sample: {'project': 'my project'}
type string | if available | The type the server group Sample: anti-affinity
uuid string | always | The unique identifier for this server Sample: cfde831a-4e87-4a75-960f-89b0148aa2cc

## Status

- This module is not guaranteed to have a backwards compatible interface. [preview]

- This module is maintained by the Ansible Community. [community]

### Authors

- René Moser (@resmo)

Hint

If you notice any issues in this documentation, you can edit this document to improve it.