community.hrobot.v_switch module – Manage Hetzner’s vSwitch
Note
This module is part of the community.hrobot collection (version 1.8.2).
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 community.hrobot
.
To use it in a playbook, specify: community.hrobot.v_switch
.
New in community.hrobot 1.7.0
Synopsis
Manage Hetzner’s vSwitch.
Parameters
Parameter |
Comments |
---|---|
The password for the Robot webservice user. |
|
The username for the Robot webservice user. |
|
The vSwitch’s name. In order to identify a vSwitch both name and VLAN must match. If not, a new vSwitch will be created. |
|
List of server identifiers (server’s numeric ID or server’s main IPv4 or IPv6). If servers is not specified, servers are not going to be deleted. |
|
State of the vSwitch. vSwitch is created if state is
When cancelling, you have to specify Choices:
|
|
Timeout (in seconds) for waiting for vSwitch servers to be configured. Default: |
|
The vSwitch’s VLAN ID. Range can be from 4000 to 4091. In order to identify a vSwitch both name and VLAN must match. If not, a new vSwitch will be created. |
|
Whether to wait until the vSwitch has been successfully configured before determining what to do, and before returning from the module. The API returns status Please note that if you disable wait while deleting and removing servers module will fail with Choices:
|
|
Delay to wait (in seconds) before checking again whether the vSwitch servers has been configured. Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Action group: community.hrobot.robot |
Use |
|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- vSwitch documentation
Hetzner’s documentation on vSwitch for connecting dedicated servers.
Examples
- name: Create vSwitch with VLAN 4010 and name foo
community.hrobot.v_switch:
hetzner_user: foo
hetzner_password: bar
vlan: 4010
name: foo
- name: Create vSwitch with VLAN 4020 and name foo with two servers
community.hrobot.v_switch:
hetzner_user: foo
hetzner_password: bar
vlan: 4010
name: foo
servers:
- 123.123.123.123
- 154323
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Information on the vSwitch. Returned: success |
|
Cancellation status. Returned: success Sample: |
|
List of assigned Cloud networks. Returned: success Sample: |
|
Gateway. Returned: success Sample: |
|
Cloud network ID. Returned: success Sample: |
|
IP address. Returned: success Sample: |
|
Subnet mask in CIDR notation. Returned: success Sample: |
|
The vSwitch’s ID. Returned: success Sample: |
|
The vSwitch’s name. Returned: success Sample: |
|
The vSwitch’s VLAN. Returned: success Sample: |
|
The server’s main IP address. Returned: success Sample: |
|
The server’s main IPv6 network address. Returned: success Sample: |
|
The server’s numeric ID. Returned: success Sample: |
|
Status of vSwitch for this server. Returned: success Can only return:
Sample: |
|
List of assigned IP addresses. Returned: success Sample: |
|
Gateway of the subnet. Returned: success Sample: |
|
IP address. Returned: success Sample: |
|
Subnet mask in CIDR notation. Returned: success Sample: |
|
The vSwitch’s VLAN ID. Returned: success Sample: |