cloudscale_ch.cloud.router module – Manages routers on the cloudscale.ch IaaS service
Note
This module is part of the cloudscale_ch.cloud collection (version 2.6.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.router.
New in cloudscale_ch.cloud 2.6.0
Synopsis
Create and remove routers.
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 this router acts as an internet gateway. Choices:
|
|
Name of the router. Either name or uuid is required. |
|
State of the router. Choices:
|
|
Tags associated with the router. Set this to |
|
UUID of the router. Either name or uuid is required. |
|
Zone slug of the router (e.g. |
Notes
Note
Updates are not supported. Changing any parameter requires deleting and recreating the router.
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 a router exists
cloudscale_ch.cloud.router:
name: my-router
zone: lpg1
api_token: xxxxxx
- name: Ensure a router with internet gateway exists
cloudscale_ch.cloud.router:
name: my-internet-gateway
zone: lpg1
internet_gateway: true
api_token: xxxxxx
- name: Ensure a router is absent
cloudscale_ch.cloud.router:
name: my-router
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 router. Returned: success Sample: |
|
API URL to get details about this router. Returned: success Sample: |
|
List of interface objects attached to this router. Returned: success |
|
List of address objects assigned to this interface. Returned: success |
|
The IP address assigned to the interface. Returned: success Sample: |
|
The reverse DNS pointer (PTR) for the address. Returned: success |
|
The subnet the address belongs to. 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: |
|
The IP version of the address ( Returned: success Sample: |
|
The MAC address of the interface. Returned: success Sample: |
|
The network this interface is attached to. Returned: success |
|
API URL to get details about the network. Returned: success Sample: |
|
The name of the network. Returned: success Sample: |
|
The unique identifier for the network. Returned: success Sample: |
|
The type of the interface (e.g. Returned: success Sample: |
|
The unique identifier for the interface. Returned: success Sample: |
|
Whether this router acts as an internet gateway. Returned: success Sample: |
|
List of internet gateway address objects (populated when internet_gateway is Returned: success |
|
The internet gateway IP address. Returned: success Sample: |
|
The reverse DNS pointer (PTR) for the address. Returned: success Sample: |
|
The subnet the address belongs to. 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: |
|
The IP version of the address ( Returned: success Sample: |
|
The name of the router. Returned: success Sample: |
|
State of the router. Returned: success Sample: |
|
The status of the router. Returned: success Sample: |
|
Tags associated with the router. Returned: success Sample: |
|
The unique identifier for the router. Returned: success Sample: |
|
The zone of the router. Returned: success Sample: |