Preparing to work with DigitalOcean
DigitalOcean has a very minimal setup. Some of the Ansible modules requires the dopy
Python module.
How to do it…
The dopy
Python module can be used for various DigitalOcean operations, so we have to install one dependency:
$ pip install dopy
Just like other Ansible modules for cloud providers, DigitalOcean modules need to interact with DigitalOcean APIs. Along with dopy
, we need an authentication token from DigitalOcean to interact with its API:
- To generate a token, we need to visit the API settings URL in the DigitalOcean dashboard (https://cloud.digitalocean.com/settings/api/tokens).
- Click on the
Generate New Token
button. A form will ask us for the name of the token and scope. - Since we are going to build droplets and other resources, we are required to select the optional
Write
scope as well.
- Once we click on the
Generate Token
button on this form, a token will be generated. We need to save this token securely in oursecrets.yml
. If lost, the token cannot...