hetzner.hcloud.hcloud_network – Create and manage cloud Networks on the Hetzner Cloud.
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_network
.
Synopsis
Create, update and manage cloud Networks on the Hetzner Cloud.
You need at least hcloud-python 1.3.0.
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 |
---|---|
This is the API Token for the Hetzner Cloud. |
|
Protect the Network for deletion. Choices:
|
|
This is the API Endpoint for the Hetzner Cloud. Default: “https://api.hetzner.cloud/v1” |
|
The ID of the Hetzner Cloud Networks to manage. Only required if no Network name is given. |
|
IP range of the Network. Required if Network does not exists. |
|
User-defined labels (key-value pairs). |
|
The Name of the Hetzner Cloud Network to manage. Only required if no Network id is given or a Network does not exists. |
|
State of the Network. Choices:
|
See Also
See also
- Documentation for Hetzner Cloud API
Complete reference for the Hetzner Cloud API.
Examples
- name: Create a basic network
hcloud_network:
name: my-network
ip_range: 10.0.0.0/8
state: present
- name: Ensure the Network is absent (remove if needed)
hcloud_network:
name: my-network
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The Network Returned: always |
|
True if Network is protected for deletion Returned: always Sample: false |
|
ID of the Network Returned: always Sample: 12345 |
|
IP range of the Network Returned: always Sample: “10.0.0.0/8” |
|
User-defined labels (key-value pairs) Returned: always Sample: {“key”: “value”, “mylabel”: 123} |
|
Name of the Network Returned: always Sample: “my-volume” |
Authors
Lukas Kaemmerling (@lkaemmerling)