mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
feat: Add integration test for force create ssh-key
with new public_key if key name already exists
This commit is contained in:
parent
728f69bd14
commit
2475969579
1 changed files with 26 additions and 1 deletions
|
|
@ -93,7 +93,7 @@
|
|||
key: value
|
||||
test: "val123"
|
||||
register: result
|
||||
- name: test update ssh key with other labels
|
||||
- name: test update ssh key with other labels
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
|
@ -136,6 +136,31 @@
|
|||
- result is failed
|
||||
- result.failure.code == "uniqueness_error"
|
||||
|
||||
- name: test force update ssh key with new public key with check mode
|
||||
hetzner.hcloud.ssh_key:
|
||||
name: "{{ hcloud_ssh_key_name }}-other-name"
|
||||
public_key: "{{ test_ssh_keypair_2.public_key }}"
|
||||
force: true
|
||||
register: result
|
||||
check_mode: true
|
||||
- name: verify force update ssh key with new public key with check mode
|
||||
assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: test force update ssh key with new public key
|
||||
hetzner.hcloud.ssh_key:
|
||||
name: "{{ hcloud_ssh_key_name }}-other-name"
|
||||
public_key: "{{ test_ssh_keypair_2.public_key }}"
|
||||
force: true
|
||||
register: ssh_key
|
||||
- name: verify force update ssh key with new public key
|
||||
assert:
|
||||
that:
|
||||
- ssh_key is changed
|
||||
- ssh_key.hcloud_ssh_key.name == "{{ hcloud_ssh_key_name }}-other-name"
|
||||
- ssh_key.hcloud_ssh_key.public_key == test_ssh_keypair_2.public_key
|
||||
|
||||
- name: test delete ssh key
|
||||
hetzner.hcloud.ssh_key:
|
||||
id: "{{ ssh_key.hcloud_ssh_key.id }}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue