An exception occurred during task execution. To see the full traceback, use -vvv. The error was: RuntimeError: HTTPSConnectionPool(host=‘api.digitalocean.com’, port=443): Max retries exceeded with url: /v2/account/keys (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc01e880da0>: Failed to establish a new connection: [Errno -2] Name or service not known’,)) fatal: [localhost]: FAILED! => {“changed”: false, “msg”: “HTTPSConnectionPool(host=‘api.digitalocean.com’, port=443): Max retries exceeded with url: /v2/account/keys (Caused by NewConnectionError(‘<urllib3.connection.VerifiedHTTPSConnection object at 0x7fc01e880da0>: Failed to establish a new connection: [Errno -2] Name or service not known’,))”}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hello,
Can you share the exact API request that you are making?
Usually, to add a new SSH key via the API the request should look as follows:
For more information you can check out the documentation here:
https://docs.digitalocean.com/reference/api/api-reference/#operation/create_ssh_key
Best,
Bobby