Hi all,<p>I'm starting a project in my company for upgrading our deployment infrastructure across cloud providers. Our current system is mainly using ansible for both provisioning and configuration management.<p>I'm trying to see Terraform as well for this option. And I wonder anyone has experience on migrating from ansible to Terraform or using both of them? And maybe can share the benefit and drawback of both of them when using them in production?
A good strategy is to use both (these are complementary tools) - one is stronger for config management (Ansible), the other for provisioning infrastructure (TF). Build and manage the infra itself (instances, security groups, VPCs etc) with TF and use Ansible to configure (e.g. install, maintain nginx on the instance). They work well together since there is a provisioner for Ansible in TF.<p>Optionally if you go the totally immutable route you may only need TF (plus somethig like packer) and not Ansible.<p>I have not had to migrate from on to the other, so unfortunately I can't be much help here. Maybe someone else can share their insights on that (including benefits/drawbacks).
Use both. If it talks ssh, Ansible. If it talks http, Terraform. I use Ansible to define what goes into Packer images. I use Terraform to deploy those images. Then I use Ansible again to flip flags or run migrations.
These are not competing tools - they are complementary. Terraform would (immutably, declaratively) build your infrastructure (as in provisioning resources). I'd use terraform if your inf. is terraform-friendly. I'd likely skip if your cloud provider is not aws.