TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Ansible vs. Terraform

11 pointsby albertlieabout 7 years ago
Hi all,<p>I&#x27;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&#x27;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?

3 comments

bprovenabout 7 years ago
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&#x27;t be much help here. Maybe someone else can share their insights on that (including benefits&#x2F;drawbacks).
评论 #16583702 未加载
cristobal23about 7 years ago
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.
评论 #16583711 未加载
avipabout 7 years ago
These are not competing tools - they are complementary. Terraform would (immutably, declaratively) build your infrastructure (as in provisioning resources). I&#x27;d use terraform if your inf. is terraform-friendly. I&#x27;d likely skip if your cloud provider is not aws.
评论 #16586592 未加载
评论 #16583684 未加载