hetzner.hcloud.hcloud_server_network – Manage the relationship between Hetzner Cloud Networks and servers
Note
This plugin is part of the hetzner.hcloud collection (version 1.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 hetzner.hcloud
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_server_network
.
Requirements
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.0.0
hcloud-python >= 1.3.0
Parameters
Parameter |
Comments |
---|---|
Alias IPs the server has. |
|
This is the API Token for the Hetzner Cloud. |
|
This is the API Endpoint for the Hetzner Cloud. Default: “https://api.hetzner.cloud/v1” |
|
The IP the server should have. |
|
The name of the Hetzner Cloud Networks. |
|
The name of the Hetzner Cloud server. |
|
State of the server_network. Choices:
|
See Also
See also
- Documentation for Hetzner Cloud API
Complete reference for the Hetzner Cloud API.
Examples
- name: Create a basic server network
hcloud_server_network:
network: my-network
server: my-server
state: present
- name: Create a server network and specify the ip address
hcloud_server_network:
network: my-network
server: my-server
ip: 10.0.0.1
state: present
- name: Create a server network and add alias ips
hcloud_server_network:
network: my-network
server: my-server
ip: 10.0.0.1
alias_ips:
- 10.1.0.1
- 10.2.0.1
state: present
- name: Ensure the server network is absent (remove if needed)
hcloud_server_network:
network: my-network
server: my-server
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The relationship between a server and a network Returned: always |
|
Alias IPs of the server within the Network ip range Returned: always Sample: [“10.1.0.1”, “…”] |
|
IP of the server within the Network ip range Returned: always Sample: “10.0.0.8” |
|
Name of the Network Returned: always Sample: “my-network” |
|
Name of the server Returned: always Sample: “my-server” |
Authors
Lukas Kaemmerling (@lkaemmerling)