cloudscale_ch.cloud.network – Manages networks 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.network
.
New in version 1.2.0: of cloudscale_ch.cloud
Parameters
Parameter |
Comments |
---|---|
Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the Default: 45 |
|
cloudscale.ch API token. This can also be passed in the |
|
cloudscale.ch API URL. This can also be passed in the Default: “https://api.cloudscale.ch/v1” |
|
Whether to automatically create an IPv4 subnet in the network or not. Choices:
|
|
The MTU of the network. Default: 9000 |
|
Name of the network. Either name or uuid is required. |
|
State of the network. Choices:
|
|
Tags assosiated with the networks. Set this to |
|
UUID of the network. Either name or uuid is required. |
|
Zone slug of the network (e.g. |
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 network exists
cloudscale_ch.cloud.network:
name: my network
api_token: xxxxxx
- name: Ensure network in a specific zone
cloudscale_ch.cloud.network:
name: my network
zone: lpg1
api_token: xxxxxx
- name: Ensure a network is absent
cloudscale_ch.cloud.network:
name: my network
state: absent
api_token: xxxxxx
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The creation date and time of the network. Returned: success Sample: “2019-05-29T13:18:42.511407Z” |
|
API URL to get details about this network. Returned: success Sample: “https://api.cloudscale.ch/v1/networks/cfde831a-4e87-4a75-960f-89b0148aa2cc” |
|
The MTU of the network. Returned: success Sample: 9000 |
|
The name of the network. Returned: success Sample: “my network” |
|
State of the network. Returned: success Sample: “present” |
|
A list of subnets objects of the network. Returned: success |
|
The CIDR of the subnet. Returned: success Sample: “172.16.0.0/24” |
|
API URL to get details about the subnet. Returned: success Sample: “https://api.cloudscale.ch/v1/subnets/33333333-1864-4608-853a-0771b6885a3” |
|
The unique identifier for the subnet. Returned: success Sample: “33333333-1864-4608-853a-0771b6885a3” |
|
Tags assosiated with the network. Returned: success Sample: {“project”: “my project”} |
|
The unique identifier for the network. Returned: success Sample: “cfde831a-4e87-4a75-960f-89b0148aa2cc” |
|
The zone of the network. Returned: success Sample: {“slug”: “rma1”} |
Authors
René Moser (@resmo)