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

Gather facts 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.8.17

Description

Gather facts about your Hetzner Cloud ssh_keys.


Requirements

Usage examples

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

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.
    - You can also set this option by using the environment variable HCLOUD_TOKEN
    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_facts:
  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 acctual 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