ansible / ansible.builtin / v2.9.25 / module / hcloud_ssh_key Create and manage ssh keys on the Hetzner Cloud. | "added in version" 2.8 of ansible.builtin" Authors: Lukas Kaemmerling (@LKaemmerling) preview | supported by communityansible.builtin.hcloud_ssh_key (v2.9.25) — module
pip
Install with pip install ansible==2.9.25
Create, update and manage ssh keys on the Hetzner Cloud.
- name: Create a basic ssh_key hcloud_ssh_key: name: my-ssh_key public_key: "ssh-rsa AAAjjk76kgf...Xt" state: present
- name: Create a ssh_key with labels hcloud_ssh_key: name: my-ssh_key public_key: "ssh-rsa AAAjjk76kgf...Xt" labels: key: value mylabel: 123 state: present
- name: Ensure the ssh_key is absent (remove if needed) hcloud_ssh_key: name: my-ssh_key state: absent
id: description: - The ID of the Hetzner Cloud ssh_key to manage. - Only required if no ssh_key I(name) is given type: int name: description: - The Name of the Hetzner Cloud ssh_key to manage. - Only required if no ssh_key I(id) is given or a ssh_key does not exists. type: str state: choices: - absent - present default: present description: - State of the ssh_key. type: str labels: description: - User-defined labels (key-value pairs) type: dict 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. required: true type: str public_key: description: - The Public Key to add. - Required if ssh_key does not exists. type: str fingerprint: description: - The Fingerprint of the Hetzner Cloud ssh_key to manage. - Only required if no ssh_key I(id) or I(name) is given. type: str
hcloud_ssh_key: contains: fingerprint: description: Fingerprint of the ssh_key returned: Always sample: b7:2f:30:a0:2f:6c:58:6c:21:04:58:61:ba:06:3b:2f type: str id: description: ID of the ssh_key returned: Always sample: 12345 type: int labels: description: User-defined labels (key-value pairs) returned: Always sample: key: value mylabel: 123 type: dict name: description: Name of the ssh_key returned: Always sample: my-ssh-key type: str public_key: description: Public key of the ssh_key returned: Always sample: ssh-rsa AAAjjk76kgf...Xt type: str description: The ssh_key instance returned: Always type: complex