hetzner.hcloud.network_member_info module – Gather info about your Hetzner Cloud Network Members.
Note
This module is part of the hetzner.hcloud collection (version 7.2.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.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: hetzner.hcloud.network_member_info.
Synopsis
Gather info about your Hetzner Cloud Network Members.
Requirements
The below requirements are needed on the host that executes this module.
python-dateutil >= 2.7.5
requests >=2.20
Parameters
Parameter |
Comments |
|---|---|
The endpoint for the Hetzner Cloud API. You can also set this option by using the Default: |
|
The endpoint for the Hetzner API. You can also set this option by using the Default: |
|
The token for the Hetzner Cloud API. You can also set this option by using the |
|
ID or Name of the Network to list the members of. Using the ID is preferred, to reduce the amount of API requests. |
|
Filter members by status. May be used multiple times. Choices:
|
|
Filter members by subnet. May be used multiple times. |
|
Filter members by type. May be used multiple times. Choices:
|
See Also
See also
- Documentation for Hetzner APIs
Complete reference for the Hetzner APIs.
Examples
- name: Gather Network Member infos
hetzner.hcloud.network_member_info:
network: my-network
type: [server, load_balancer]
status: [ok, attaching, detaching, updating, error]
subnet: [10.0.1.0/24]
register: output
- name: Print the gathered infos
debug:
var: output.hcloud_network_member_info
- name: Collect all Network Member ips
ansible.builtin.set_fact:
network_ips: >
{{
output.hcloud_network_member_info | map(attribute='ip') +
output.hcloud_network_member_info | map(attribute='alias_ips') | flatten
}}
- name: Print all Network Member ips
debug:
var: network_ips
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Network Members infos as list. Returned: always |
|
Additional IP addresses of the Resource within the Network. Returned: always Sample: |
|
ID of the Resource attached to the Network. Returned: always Sample: |
|
IP address of the Resource within the Network. Returned: always Sample: |
|
Status of the Resource within the Network. Returned: always Sample: |
|
IP range of the subnet the Resource is attached to. Returned: always Sample: |
|
Type of the Resource attached to the Network. Returned: always Sample: |