← Back to context

Comment by mhitza

1 year ago

For my own projects I do Terraform/Pulumi + Ansible. I use Hetzner & DigitalOcean and this setup works great with both.

I don't use docker for my projects, as I deploy on RHEL like systems which I'm intimately familiar how to configure (and have snippets I mix and match).

You use both terraform and ansible in the same project? I always thought of them as competitors filling more or less the same role, do you find it useful to use them together? Is it that hetzner and digitalocean TF providers do a good job but provide limited functionality, and ansible fills in the gaps for you?

  • I don't think they are competitor, and if someone uses Ansible for infra I think they are using the wrong tool (mind you, last time I checked Ansibles's infra tooling few years back it wasn't adequate in my opinion).

    I use Terraform to spin up the infra (vm, storage, firewalls, load balancers, DNS, etc) that the cloud services offer. Then when the VM is up I either run Ansible via local-exec Terraform provisioner, or after the fact via separate invocations.

    I use Ansible to install, configure and deploy software on Linux VMs exclusively. For client projects, or those that need fast scalability on-demand, I will also use Packer+Ansible to build preconfigured VM images which I can then spin up via Terraform separately.

    Hetzner and DigitalOcean providers are first party (partenered with HashiCorp) so you have assurance that what's in the docs works. This is true for most mid/large cloud providers.