The drawbacks of using Terraform for config management

Hi,

I’ve finished the course " Terraform Basics Training Course", and here’s the question that I think the course didn’t fully cover:
One of the common patterns is to use the provisioning tool + config management tool. I would like to know what the inconveniences are or what are the drawbacks when using Terraform to do the config management work so that we have to use Ansible or Saltstack.
It’s even better if there are some use cases in the example.
thanks a lot.

It’s fairly straight forward.

Terraform is for infrastructure provisioning.
Ansible/Salt/Chef/Puppet are for config management.

You don’t use a fork to cut your food. It does not do a very good job, that’s why you use a knife! Similarly here.

Different tools for different use cases.

I appreciate the straightforward explanation. However, I strongly believe that there’s immense value in delving into the ‘why’ behind each tool’s role and exploring the broader possibilities they offer in the realm of infrastructure management.

Take Ansible, for instance; it’s not just about understanding that it can handle provisioning tasks as well. The real insight lies in uncovering why people often opt for a combination of Terraform and Ansible. While Ansible does have provisioning capabilities, the reason why many choose to complement it with Terraform likely stems from certain inconveniences or limitations in the provisioning process itself.

Understanding these reasons and the specific use cases where Terraform and Ansible shine individually can be crucial in explaining to a company or employer why the two-tool approach makes sense. It’s not merely about drawing a fork-and-knife analogy; it’s about showcasing the practical advantages, flexibility, and efficiency gained from using the right tool for the right job in different parts of the infrastructure lifecycle.

This is what I am actually asking for. Hope you can understand my point.

Why?

Ansible is amnesic. Terraform is not.

Thank you for providing an explanation, but I’m not familiar with the word ‘amnesic.’ This term is new to me, and I would appreciate further clarification or an explanation of its meaning.

If you ask Terraform to give you 20 VM Instances on the Cloud, Terraform will happily give you 20 VM instances on the Cloud, during first run.

If you then ask Terraform to give you 5 more VM Instances by changing IaC code number to 25, Terraform will give you 5 more VM Instances.

If you ask Ansible to give you 20 VM Instances on the Cloud, Ansible will happily give you 20 VM instances on the Cloud, during first run.

If you then ask Ansible to give you 5 more VM Instances by changing IaC code number to 25, Ansible will give you 25 more VM Instances.

Amnesic Definition & Meaning | Merriam-Webster Medical

of, relating to, or causing amnesia

Terraform store state about your managed infrastructure and configuration. (Therefore it does remember)

Ansible does not have state concept, it has playbook and tasks (and some more other concepts but not state) and when playbook ends Ansible does not remember what it has done.