community.hrobot.firewall_info module – Manage Hetzner’s dedicated server firewall
Note
This module is part of the community.hrobot collection (version 2.0.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.firewall_info
.
Synopsis
Manage Hetzner’s dedicated server firewall.
Parameters
Parameter |
Comments |
---|---|
The password for the Robot web-service user. |
|
The username for the Robot web-service user. |
|
The server’s main IP address. Exactly one of Note that Hetzner deprecated identifying the server’s firewall by the server’s main IP. Using this option can thus stop working at any time in the future. Use |
|
The server’s number. Exactly one of |
|
Timeout (in seconds) for waiting for firewall to be configured. Default: |
|
Delay to wait (in seconds) before checking again whether the firewall has been configured. Default: |
|
Whether to wait until the firewall has been successfully configured before returning from the module. The API returns status Please note that there is a request limit. If you have to do multiple updates, it can be better to disable waiting, and regularly use community.hrobot.firewall_info to query status. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Action group: community.hrobot.robot added in community.hrobot 1.6.0 |
Use |
|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Will return details on what has changed (or possibly needs changing in |
See Also
See also
- Firewall documentation
Hetzner’s documentation on the stateless firewall for dedicated servers
- community.hrobot.firewall
Configure firewall.
Examples
- name: Get firewall configuration for server with main IP 1.2.3.4
community.hrobot.firewall_info:
hetzner_user: foo
hetzner_password: bar
server_ip: 1.2.3.4
register: result
- ansible.builtin.debug:
msg: "{{ result.firewall }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The firewall configuration. Returned: success |
|
Whether Hetzner services have access. Returned: success Sample: |
|
Whether the firewall rules apply to IPv6 as well or not. Returned: success Sample: |
|
Switch port of firewall.
Returned: success Sample: |
|
Firewall rules. Returned: success |
|
Input firewall rules. Returned: success |
|
Action if rule matches.
Returned: success Can only return:
Sample: |
|
Destination IP address or subnet address. CIDR notation. Returned: success Sample: |
|
Destination port or port range. Returned: success Sample: |
|
Internet protocol version. No value means the rule applies both to IPv4 and IPv6. Returned: success Sample: |
|
Name of the firewall rule. Returned: success Sample: |
|
Protocol above IP layer. Returned: success Sample: |
|
Source IP address or subnet address. CIDR notation. Returned: success |
|
Source port or port range. Returned: success |
|
TCP flags or logical combination of flags. Returned: success |
|
Output firewall rules. Returned: success |
|
Action if rule matches.
Returned: success Can only return:
Sample: |
|
Destination IP address or subnet address. CIDR notation. Returned: success Sample: |
|
Destination port or port range. Returned: success Sample: |
|
Internet protocol version. No value means the rule applies both to IPv4 and IPv6. Returned: success |
|
Name of the firewall rule. Returned: success Sample: |
|
Protocol above IP layer. Returned: success Sample: |
|
Source IP address or subnet address. CIDR notation. Returned: success |
|
Source port or port range. Returned: success |
|
TCP flags or logical combination of flags. Returned: success |
|
Server’s main IP address. Returned: success Sample: |
|
Hetzner’s internal server number. Returned: success Sample: |
|
Status of the firewall.
Will be Returned: success Sample: |
|
Whether Hetzner services have access. Old name of return value Returned: success Sample: |