ansible/test/legacy/roles/test_digital_ocean/tasks/sshkey.yml
Patrick Marques d9a17e098c Digital Ocean Integration tests (#29960)
* Digital Ocean Integration tests
2018-11-28 12:07:47 +00:00

25 lines
556 B
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
- name: Create ssh key
digital_ocean_sshkey:
name: test-key1
ssh_pub_key: "{{ dummy_ssh_pub_key }}"
oauth_token: "{{ digitalocean_oauth_token }}"
register: result
- name: Verify that SSH key was created
assert:
that:
- "result.changed"
- name: "Delete ssh key"
digital_ocean_sshkey:
state: "absent"
fingerprint: "{{ result.data.ssh_key.fingerprint }}"
oauth_token: "{{ digitalocean_oauth_token }}"
register: result
- name: Verify that SSH key was deleted
assert:
that:
- "result.changed"