Skip to content

sucho-archiving/sucho-server-provisioning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

sucho-server-provisioning

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.

Setup

  1. Install Ansible (>= 2.12) locally (https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)

  2. Create a Digital Ocean Personal Access Token to use as an API key (https://docs.digitalocean.com/reference/api/create-personal-access-token/)

  3. 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)

  4. Checkout this repo and cd into it

Usage

  1. 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>
  2. Find the IP address of the newly-created droplet (<do-droplet-id> below):

    doctl compute droplet get <droplet-name> --format PublicIPv4
    
  3. 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.