On this page
cloudscale_ch.cloud.server_group – Manages server groups on the cloudscale.ch IaaS service
Note
This plugin is part of the cloudscale_ch.cloud collection (version 2.2.0).
You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install cloudscale_ch.cloud.
To use it in a playbook, specify: cloudscale_ch.cloud.server_group.
New in version 1.0.0: of cloudscale_ch.cloud
Synopsis
- Create, update and remove server groups.
 
Parameters
| Parameter | Choices/Defaults | Comments | 
|---|---|---|
| api_timeout
        
        integer
         | 
      Default: 
        45
         | 
      
        
        Timeout in seconds for calls to the cloudscale.ch API.
        
       
        This can also be passed in the  CLOUDSCALE_API_TIMEOUT environment variable.
        | 
     
| api_token
        
        string / required
         | 
      
        
        cloudscale.ch API token.
        
       
        This can also be passed in the  CLOUDSCALE_API_TOKEN environment variable.
        | 
     |
| api_url
        
        string
        
       
        added in 1.3.0 of cloudscale_ch.cloud
         | 
      Default: 
        "https://api.cloudscale.ch/v1"
         | 
      
        
        cloudscale.ch API URL.
        
       
        This can also be passed in the  CLOUDSCALE_API_URL environment variable.
        | 
     
| name
        
        string
         | 
      
        
        Name of the server group.
        
       
        Either name or uuid is required. These options are mutually exclusive.
         | 
     |
| state
        
        string
         | 
      
       
  | 
      
        
        State of the server group.
         | 
     
| tags
        
        dictionary
         | 
      
        
        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.
         | 
     |
| zone
        
        string
         | 
      
        
        Zone slug of the server group (e.g.  lgp1 or rma1).
        | 
     
Notes
Note
- 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_ch.cloud.server_group:
    name: my-name
    type: anti-affinity
    api_token: xxxxxx
- name: Ensure server group in a specific zone
  cloudscale_ch.cloud.server_group:
    name: my-rma-group
    type: anti-affinity
    zone: lpg1
    api_token: xxxxxx
- name: Ensure a server group is absent
  cloudscale_ch.cloud.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 / elements=string
         | 
      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
         | 
      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
         | 
     
| zone
        
        dictionary
         | 
      success | 
        
        The zone of the server group
         Sample:
        
       
        {'slug': 'rma1'}
         | 
     
Authors
- René Moser (@resmo)
 - Denis Krienbühl (@href)
 
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
 https://docs.ansible.com/ansible/latest/collections/cloudscale_ch/cloud/server_group_module.html