community.hrobot.ssh_key module – Add, remove or update SSH key
Note
This module is part of the community.hrobot collection (version 1.8.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 public_key and fingerprint are required if state=absent. |
|
The password for the Robot webservice user. |
|
The username for the Robot webservice user. |
|
The public key’s name. Required if state=present, and ignored if state=absent. |
|
The public key data in OpenSSH format. Example: One of public_key and fingerprint are required if state=absent. Required if state=present. |
|
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 |
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: |
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication