- Docs »
- hetzner.hcloud.hcloud_network – Create and manage cloud Networks on the Hetzner Cloud.
-
You are reading an older version of the Ansible documentation. Use the version selection to the left if you want the latest stable released version.
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.2.1).
To install it use: ansible-galaxy collection install hetzner.hcloud
.
To use it in a playbook, specify: hetzner.hcloud.hcloud_network
.
Create, update and manage cloud Networks on the Hetzner Cloud.
You need at least hcloud-python 1.3.0.
The below requirements are needed on the host that executes this module.
hcloud-python >= 1.0.0
hcloud-python >= 1.3.0
Parameter |
Choices/Defaults |
Comments |
api_token
string
/ required
|
|
This is the API Token for the Hetzner Cloud.
|
delete_protection
boolean
|
|
Protect the Network for deletion.
|
endpoint
string
|
Default:
"https://api.hetzner.cloud/v1"
|
This is the API Endpoint for the Hetzner Cloud.
|
id
integer
|
|
The ID of the Hetzner Cloud Networks to manage.
Only required if no Network name is given.
|
ip_range
string
|
|
IP range of the Network.
Required if Network does not exists.
|
labels
dictionary
|
|
User-defined labels (key-value pairs).
|
name
string
|
|
The Name of the Hetzner Cloud Network to manage.
Only required if no Network id is given or a Network does not exists.
|
state
string
|
Choices:
- absent
present ←
|
State of the Network.
|
- 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
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
hcloud_network
complex
|
always |
The Network
|
|
delete_protection
boolean
added in 0.1.0 of hetzner.hcloud |
always |
True if Network is protected for deletion
|
|
id
integer
|
always |
ID of the Network
Sample:
12345
|
|
ip_range
string
|
always |
IP range of the Network
Sample:
10.0.0.0/8
|
|
labels
dictionary
|
always |
User-defined labels (key-value pairs)
Sample:
{'key': 'value', 'mylabel': 123}
|
|
name
string
|
always |
Name of the Network
Sample:
my-volume
|