make the fail message more understandable. Fixes #217

pull/242/head
Jack Ivanov 7 years ago
parent 8d21923b70
commit 257be0f395

@ -3,16 +3,20 @@
do_token: "{{ do_access_token }}"
public_key: "{{ lookup('file', '{{ SSH_keys.public }}') }}"
- name: "Delete the existing Algo SSH keys"
digital_ocean:
state: absent
command: ssh
api_token: "{{ do_access_token }}"
name: "{{ SSH_keys.comment }}"
register: ssh_keys
until: ssh_keys.changed != 1
retries: 10
delay: 1
- block:
- name: "Delete the existing Algo SSH keys"
digital_ocean:
state: absent
command: ssh
api_token: "{{ do_access_token }}"
name: "{{ SSH_keys.comment }}"
register: ssh_keys
until: ssh_keys.changed != true
retries: 10
delay: 1
rescue:
- fail:
msg: "Please, ensure that your API token is not read-only."
- name: "Upload the SSH key"
digital_ocean:

Loading…
Cancel
Save