Terraform and ansible
For proof of concepts, I need a way to quickly spin up the test droplet with Docker installed.
In this post, I will you show an example to get this done with terraform and ansible.
- provision new droplet and firewall configuration:
- generate local ansible inventory with the newly created droplet IPv4 address:
- run ansible-playbook to setup docker service on the remote host:
- firewall configuration includes Cloudflare external IPv4 subnets (from here);
Source code: kariedo/terraform-ansible-docker-example
Before you start you need to adjust your local IP (
home_ipv4_addr) and SSH fingerprint (
ssh_fingerprint) variables in