A quick and clean way to start a single-node Redis cluster on a DigitalOcean Droplet.
The following binaries must be present on the host machine:
ansible-playbook
ansible-galaxy
terraform
Clone this repostory and move into it:
git clone https://github.com/PhillipVH/digitalocean-redis-quickstart.git
cd digitalocean-redis-quickstart
Install the Redis role from Ansible Galaxy:
ansible-galaxy install DavidWittman.redis
Populate the terraform/terraform.tfvars
file with your DigitalOcean API key, the path to your private and public keys, and the MD5 fingerprint of your public key. The provided terraform/terraform.tfvars.example
file can be used as a reference.
Initialize Terraform:
cd terraform
terraform init
Run the Terraform definition
terraform apply
This command implicitly runs the Ansible playbook on the newly created droplet.
To confirm that everything is working find the IP address of your new Droplet using terraform show
, and ping it with Redis:
redis-cli -h <ipaddress> ping
If all went well, the above command will respond with PONG
.
To destroy the infrastructure created, simply move into the terraform
directory and run:
terraform destroy