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

Gather infos about your Hetzner Cloud ssh_keys.

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

Authors: Christopher Schmitt (@cschmitt-hcloud)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.25

Description

Gather facts about your Hetzner Cloud ssh_keys.

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


Requirements

Usage examples

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

Inputs

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

name:
    description:
    - The name of the ssh key 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

fingerprint:
    description:
    - The fingerprint of the ssh key you want to get.
    type: str

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

Outputs

hcloud_ssh_key_info:
  contains:
    fingerprint:
      description: Fingerprint of the ssh key
      returned: always
      sample: 0e:e0:bd:c7:2d:1f:69:49:94:44:91:f1:19:fd:35:f3
      type: str
    id:
      description: Numeric identifier of the ssh_key
      returned: always
      sample: 1937415
      type: int
    labels:
      description: User-defined labels (key-value pairs)
      returned: always
      type: dict
    name:
      description: Name of the ssh_key
      returned: always
      sample: my-ssh-key
      type: str
    public_key:
      description: The actual public key
      returned: always
      sample: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGpl/tnk74nnQJxxLAtutUApUZMRJxryKh7VXkNbd4g9
        john@example.com
      type: str
  description: The ssh key instances
  returned: Always
  type: complex

See also