cloudscale_ch.cloud.network module – Manages networks on the cloudscale.ch IaaS service
Note
This module is part of the cloudscale_ch.cloud collection (version 2.3.1).
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 cloudscale_ch.cloud 1.2.0
Synopsis
Create, update and remove networks.
Parameters
Parameter |
Comments |
---|---|
Timeout in seconds for calls to the cloudscale.ch API. This can also be passed in the Default: |
|
cloudscale.ch API token. This can also be passed in the |
|
cloudscale.ch API URL. This can also be passed in the Default: |
|
Whether to automatically create an IPv4 subnet in the network or not. Choices:
|
|
The MTU of the network. Default: |
|
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: |
|
API URL to get details about this network. Returned: success Sample: |
|
The MTU of the network. Returned: success Sample: |
|
The name of the network. Returned: success Sample: |
|
State of the network. Returned: success Sample: |
|
A list of subnets objects of the network. Returned: success |
|
The CIDR of the subnet. Returned: success Sample: |
|
API URL to get details about the subnet. Returned: success Sample: |
|
The unique identifier for the subnet. Returned: success Sample: |
|
Tags assosiated with the network. Returned: success Sample: |
|
The unique identifier for the network. Returned: success Sample: |
|
The zone of the network. Returned: success Sample: |