ansible.builtin.hcloud_datacenter_info (v2.9.25) — module

Gather info about the Hetzner Cloud datacenters.

| "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.9.25

Description

Gather info about your Hetzner Cloud datacenters.

This module was called C(hcloud_datacenter_facts) before Ansible 2.9, returning C(ansible_facts) and C(hcloud_datacenter_facts). Note that the M(hcloud_datacenter_info) module no longer returns C(ansible_facts) and the value was renamed to C(hcloud_datacenter_info)!


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Gather hcloud datacenter info
  hcloud_datacenter_info:
  register: output
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Print the gathered info
  debug:
    var: output

Inputs

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

name:
    description:
    - The name of the datacenter 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.
    required: true
    type: str

Outputs

hcloud_datacenter_info:
  contains:
    city:
      description: City of the location
      returned: always
      sample: fsn1
      type: str
    description:
      description: Detail description of the datacenter
      returned: always
      sample: Falkenstein DC 8
      type: str
    id:
      description: Numeric identifier of the datacenter
      returned: always
      sample: 1937415
      type: int
    location:
      description: Name of the location where the datacenter resides in
      returned: always
      sample: fsn1
      type: str
    name:
      description: Name of the datacenter
      returned: always
      sample: fsn1-dc8
      type: str
  description:
  - The datacenter info as list
  - This module was called C(hcloud_datacenter_facts) before Ansible 2.9, returning
    C(ansible_facts) and C(hcloud_datacenter_facts). Note that the M(hcloud_datacenter_info)
    module no longer returns C(ansible_facts) and the value was renamed to C(hcloud_datacenter_info)!
  returned: always
  type: complex

See also