There are two ways to log into a DigitalOcean droplet. If public key information is supplied during the creation of the droplet, then it will be added to the root user of the droplet. Otherwise, a one-time password is emailed to the registered user ID. Because of security implications, we strongly recommend using public keys and not passwords for logging in.
Adding SSH keys to a DigitalOcean account
How to do it...
- For adding an SSH public key to our account, we will use the digital_ocean_sshkey module:
- name: Add SSH key to DO account
digital_ocean_sshkey:
name: "cookbook-key"
ssh_pub_key: "{{ ssh_public_key }}"
oauth_token: "{{ DO_OAUTH_TOKEN }}"
We have supplied a name along with...