community.hrobot.ssh_key module – Add, remove or update SSH key
Note
This module is part of the community.hrobot collection (version 2.1.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
.
New in community.hrobot 1.2.0
Synopsis
Add, remove or update an SSH key stored in Hetzner’s Robot.
Parameters
Parameter |
Comments |
---|---|
The MD5 fingerprint of the public SSH key to remove. One of |
|
The password for the Robot web-service user. |
|
The username for the Robot web-service user. |
|
The public key’s name. Required if |
|
The public key data in OpenSSH format. Example: One of Required if |
|
Timeout (in seconds) for waiting when rate limit exceeded errors are returned. Set to Set to a negative value like Default: |
|
Whether to make sure a public SSH key is present or absent.
Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Action group: community.hrobot.robot added in community.hrobot 1.6.0 |
Use |
|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
|
Support: full |
When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change. This assumes that the system controlled/queried by the module has not changed in a relevant way. |
See Also
See also
- community.hrobot.ssh_key_info
Query information on SSH keys.
Examples
- name: Add an SSH key
community.hrobot.ssh_key:
hetzner_user: foo
hetzner_password: bar
state: present
name: newKey
public_key: ssh-rsa AAAAB3NzaC1yc+...
- name: Remove a SSH key by fingerprint
community.hrobot.ssh_key:
hetzner_user: foo
hetzner_password: bar
state: absent
fingerprint: cb:8b:ef:a7:fe:04:87:3f:e5:55:cd:12:e3:e8:9f:99
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The MD5 fingerprint of the key. This is the value used to reference the SSH public key, for example in the community.hrobot.boot module. Returned: success Sample: |