mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
##### SUMMARY - Log a warning when the provided public key does not match one in the API. - When the public key does not match the one in the API, allow recreating the SSH Key in the API using the ``force=true`` argument. Closes: #578 ##### ISSUE TYPE - Feature Pull Request ##### COMPONENT NAME <!--- Write the short name of the module, plugin, task or feature below --> `ssh_key` ##### ADDITIONAL INFORMATION In Hetzner API, we do not have any public_key change endpoint and only updating names and labels are allowed. For public_key The only way is removing and re-creating. `force` option allows users to do re-creation if needed. --------- Co-authored-by: jo <ljonas@riseup.net>
31 lines
852 B
YAML
31 lines
852 B
YAML
---
|
|
# https://github.com/ansible-collections/community.crypto/pull/504
|
|
- name: Create temporary directory for test_ssh_keypair
|
|
ansible.builtin.file:
|
|
state: directory
|
|
path: ~/tmp
|
|
mode: "0755"
|
|
|
|
- name: Create temporary file for test_ssh_keypair
|
|
ansible.builtin.tempfile:
|
|
path: ~/tmp
|
|
suffix: "{{ hcloud_ssh_key_name }}"
|
|
register: _tmp_ssh_key_file
|
|
|
|
- name: Create test_ssh_keypair
|
|
community.crypto.openssh_keypair:
|
|
path: "{{ _tmp_ssh_key_file.path }}"
|
|
force: true
|
|
register: test_ssh_keypair
|
|
|
|
- name: Create temporary file for test_ssh_keypair2
|
|
ansible.builtin.tempfile:
|
|
path: ~/tmp
|
|
suffix: "{{ hcloud_ssh_key_name }}"
|
|
register: _tmp_ssh_key_file2
|
|
|
|
- name: Create test_ssh_keypair2
|
|
community.crypto.openssh_keypair:
|
|
path: "{{ _tmp_ssh_key_file2.path }}"
|
|
force: true
|
|
register: test_ssh_keypair2
|