Ansible playbook for provisioning a DigitalOcean droplet for running webrecorder/browsertrix-crawler.
The droplet is configured with docker, docker-compose, and the AWS CLI. The browsertrix docker image is pulled, and an SSH public key is installed for a user who has passwordless sudo on the droplet.
-
Install Ansible (>= 2.12) locally (https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)
-
Create a Digital Ocean Personal Access Token to use as an API key (https://docs.digitalocean.com/reference/api/create-personal-access-token/)
-
Upload an SSH public key to Digital Ocean (https://docs.digitalocean.com/products/droplets/how-to/add-ssh-keys/to-account/), and copy the fingerprint that's created (
<admin-ssh-key-fingerprint>
below) -
Checkout this repo and
cd
into it
-
Create a droplet:
doctl compute droplet create --region fra1 --image ubuntu-20-04-x64 --size s-8vcpu-16gb <droplet-name> --ssh-keys <admin-ssh-key-fingerprint>
-
Find the IP address of the newly-created droplet (
<do-droplet-id>
below):doctl compute droplet get <droplet-name> --format PublicIPv4
-
Run the playbook against the droplet:
ansible-playbook -u root -i '<do-droplet-ip>,' -e "user=<user-to-configure>" -e "pub_key='$(</path-to-ssh-public-key)'" browsertrix.playbook.yaml
You can read the SSH public key from a file, as in the example above, or just provide it as a string.