Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Terraform provisions machines (and also infra, etc), and Ansible configures provisioned machines

Ansible can provision virtual machines as well, and from my experience it is better suited for it too, since it doesn't save state outside the system. So there's lesser chance for it to get out of sync.

It's mostly culture. People these days learn GKE or Kubernetes first, and their tutorials mention Terraform so that's what they'll use. It used to be managed VMs and that culture was around Puppet, Ansible or Salt.



> Ansible can provision virtual machines as well, and from my experience it is better suited for it too, since it doesn't save state outside the system. So there's lesser chance for it to get out of sync.

State serves a purposes, it's not just there for fun. Ansible will lose track of your VM if you rename it (and can barely handle you renaming it with itself), and won't delete it if you just delete it from the configuration file.


> State serves a purposes, it's not just there for fun

The system has state. The question is how we want to manage it. The design in this case chooses to opimize to lessen the impact of errors. All real world systems are prone to errors in the long run.

If real world parables are excused: If the map (serialized state) and terrain (system state) differs, is it a good idea to insist on following the map?

> Ansible will lose track of your VM if you rename it

Sure, but so will Terraform. Or worse.

> won't delete it if you just delete it from the configuration

Sure it can. There are no limitations there. The only questions are whether you want it to, and how you want it to.

Ansible is a superset of Terraform. It's mostly a matter of culture which tool people choose, and which you think is the easiest to use.


> If the map (serialized state) and terrain (system state) differs, is it a good idea to insist on following the map?

If you're doing landscaping and the map is your requirements, yes. And that's what infrastructure is comparable to (hence Terraform's name btw)

> > Ansible will lose track of your VM if you rename it

> Sure, but so will Terraform. Or worse.

No it won't, because Terraform stores the underlying platform ID in it's state. It will just know there was a rename, and will inform you it plans on rolling it back to what you have requested in the configuration. It won't delete it. Ansible will want to recreate it, with all conflicts this could bring.

> Ansible is a superset of Terraform. It's mostly a matter of culture which tool people choose, and which you think is the easiest to use.

It's a different tool for a different job (at which it isn't great due to using a markup language which really doesn't lend itself to templating with lots of templating, and a dynamic language that suffers from version and dependency hell).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: