ansible.builtin.hcloud_server_facts (v2.8.17) — module

Gather facts about your Hetzner Cloud servers.

| "added in version" 2.8 of ansible.builtin"

Authors: Lukas Kaemmerling (@lkaemmerling)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.8.17

Description

Gather facts about your Hetzner Cloud servers.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather hcloud server facts
  local_action:
    module: hcloud_server_facts
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print the gathered facts
  debug:
    var: ansible_facts.hcloud_server_facts

Inputs

    
id:
    description:
    - The ID of the server you want to get.
    type: int

name:
    description:
    - The name of the server you want to get.
    type: str

endpoint:
    default: https://api.hetzner.cloud/v1
    description:
    - This is the API Endpoint for the Hetzner Cloud.
    type: str

api_token:
    description:
    - This is the API Token for the Hetzner Cloud.
    - You can also set this option by using the environment variable HCLOUD_TOKEN
    required: true
    type: str

label_selector:
    description:
    - The label selector for the servery you want to get.
    type: str

Outputs

hcloud_server_facts:
  contains:
    backup_window:
      description: Time window (UTC) in which the backup will run, or null if the
        backups are not enabled
      returned: always
      sample: 22-02
      type: bool
    datacenter:
      description: Name of the datacenter of the server
      returned: always
      sample: fsn1-dc14
      type: str
    id:
      description: Numeric identifier of the server
      returned: always
      sample: 1937415
      type: int
    ipv4_address:
      description: Public IPv4 address of the server
      returned: always
      sample: 116.203.104.109
      type: str
    ipv6:
      description: IPv6 network of the server
      returned: always
      sample: 2a01:4f8:1c1c:c140::/64
      type: str
    labels:
      description: User-defined labels (key-value pairs)
      returned: always
      type: dict
    location:
      description: Name of the location of the server
      returned: always
      sample: fsn1
      type: str
    name:
      description: Name of the server
      returned: always
      sample: my-server
      type: str
    rescue_enabled:
      description: True if rescue mode is enabled, Server will then boot into rescue
        system on next reboot
      returned: always
      sample: false
      type: bool
    server_type:
      description: Name of the server type of the server
      returned: always
      sample: cx11
      type: str
    status:
      description: Status of the server
      returned: always
      sample: running
      type: str
  description: The server facts as list
  returned: always
  type: complex

See also