Note
This plugin is part of the community.hrobot collection (version 1.2.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 version 1.2.0: of community.hrobot
Parameter | Choices/Defaults | Comments |
---|---|---|
fingerprint string | The MD5 fingerprint of the public SSH key to remove. One of public_key and fingerprint are required if state=absent. | |
hetzner_password string / required | The password for the Robot webservice user. | |
hetzner_user string / required | The username for the Robot webservice user. | |
name string | The public key's name. Required if state=present, and ignored if state=absent. | |
public_key string | The public key data in OpenSSH format. Example: ssh-rsa AAAAB3NzaC1yc+...
One of public_key and fingerprint are required if state=absent. Required if state=present. | |
state string / required |
| Whether to make sure a public SSH key is present or absent. present makes sure that the SSH key is available, and potentially updates names for existing SHS public keys.absent makes sure that the SSH key is not available. The fingerprint or public key data is used for matching the key. |
See also
Query information on SSH keys
- 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
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
fingerprint string | success | 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. Sample: cb:8b:ef:a7:fe:04:87:3f:e5:55:cd:12:e3:e8:9f:99 |
© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/hrobot/ssh_key_module.html