community.hrobot.ssh_key_info module – Query information on SSH keys

Note

This module is part of the community.hrobot collection (version 1.4.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 community.hrobot.

To use it in a playbook, specify: community.hrobot.ssh_key_info.

New in version 1.2.0: of community.hrobot

Synopsis

  • List information on all your SSH keys stored in Hetzner’s Robot.

Parameters

Parameter

Comments

hetzner_password

string / required

The password for the Robot webservice user.

hetzner_user

string / required

The username for the Robot webservice user.

See Also

See also

community.hrobot.ssh_key

Add, remove or update SSH key

Examples

- name: List all SSH keys
  community.hrobot.ssh_key_info:
    hetzner_user: foo
    hetzner_password: bar
  register: ssh_keys

- name: Show how many keys were found
  ansible.builtin.debug:
    msg: "Found {{ ssh_keys.ssh_keys | length }} keys"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

ssh_keys

list / elements=dictionary

The list of all SSH keys stored in Hetzner’s Robot for your user.

Returned: success

data

string

The key data in OpenSSH’s format.

Returned: success

Sample: “ecdsa-sha2-nistp521 AAAAE2VjZHNh …”

fingerprint

string

The key’s MD5 fingerprint.

Returned: success

Sample: “56:29:99:a4:5d:ed:ac:95:c1:f5:88:82:90:5d:dd:10”

name

string

The key’s name shown in the UI.

Returned: success

Sample: “key1”

size

integer

The key’s size in bits.

Returned: success

Sample: 521

type

string

The key’s algorithm type.

Returned: success

Sample: “ECDSA”

Authors

  • Felix Fontein (@felixfontein)