Ansible vs. Terraform: What's the difference?

preview_player
Показать описание

Ansible and Terraform are both great tools that you can turn to for creating Infrastructure as Code (IaC) which can be used to deploy repeatable environments for automating your infrastructure. However, what is the difference between the two? When should you pick one over the other?

In this lightboard video, Sai Vennam with IBM Cloud, dives deep into how Ansible and Terraform both serve different purposes as well as complement each other for automating infrastructure.

#Ansible #Terraform #ITAutomation
Рекомендации по теме
Комментарии
Автор

Similarities: supports templating, open source, agentless (plug and play), infrastructure as a code, provisioning infrastructure

Terraform: primary use as infrastructure provisioning tool, declarative (define what end result you want), state management, new and evolving

Ansible: primary use as configuration tool, hybrid, no lifecycle management

We can both as complementary:
* Start with Terraform: use Terraform to spin up an infrastructure, once infra is ready, use Terraform to call Ansible to do config management on the resources you spun up.
* Start with Ansible: in Step1 of playbook: call Terraform to spin up infra and then pick up where Terraform leaves off, take that infra and run the Ansible actions on that

shyamutty
Автор

I love how whenever Sai hosts a Vs. video, he always starts by saying they are complementary tools

aamirprincedjearam
Автор

thanks Sai. Great presentation. You do a great job of explaining these complex topics in an understandable way. Cheers!

DaveOtteman
Автор

Awesome explanation I really appreciate you going over the differences between Terraform and Ansible.

mstevensn
Автор

good to know that we could really work together combining Ansible and terraform

vasudevadernierstuff
Автор

Here’s a summary of the key differences and synergies between Terraform and Ansible as explained in the YouTube video:
1. Purpose and Functionality:
• Terraform is primarily used for provisioning infrastructure in a declarative manner, allowing users to define what the infrastructure should look like and then automatically managing the creation process to match that definition.
• Ansible excels in configuration management and application deployment. It can also provision infrastructure, but it operates in a more procedural/hybrid manner, where actions are executed in the order they are defined.
2. Operational Method:
• Terraform operates declaratively, automatically handling dependencies and order of operations, which means it can execute tasks in an optimized sequence based on resource dependencies.
• Ansible is more procedural, where tasks are run in the sequence they are written, though it supports declarative elements. This requires careful planning of task order to ensure operations are performed correctly.
3. State Management and Idempotency:
• Terraform tracks the state of the infrastructure and applies changes incrementally to avoid re-provisioning resources that are already in the desired state. This state management also allows Terraform to remove resources when their definitions are deleted from the configuration.
• Ansible does not track state in the same way, so lifecycle changes need to be manually managed. While Ansible tasks can be made idempotent, this is not automatic and must be explicitly designed into the playbooks.
4. Community and Extensions:
• Both tools boast strong community support and extensive libraries of modules or playbooks that facilitate quick setup and integration with various technologies. Terraform has the Terraform Registry, and Ansible has Ansible Galaxy.
5. Integration and Usage Together:
• The two tools are complementary when used together within an automation workflow. Terraform can be used to provision the initial infrastructure, which can then be managed and configured by Ansible, integrating their strengths for a robust automation strategy.
This explanation highlights that while Terraform and Ansible have some overlapping capabilities, they each have unique strengths that make them suitable for different aspects of infrastructure automation.

AbdullahOllivierreIT
Автор

It was a good explanation that reminded me of what I knew and what I am currently doing. I totally agree with the opinion that Ansible and Terraform can be used together. However, in reality, if our colleague have enough experience with these two scripts, there will be no problem, I am a little curious as to whether there will be sensibility when considering the learning cost. Thanks, Sai

StevenJSMin
Автор

Liked it very much. Helps a layman like me to understand the concepts. Keep doing more of it

satishsindiri
Автор

Great video as always Sai! I love your style of breaking down seemingly complex topics like this into easily digestible tidbits. IBM / Red Hat is lucky to have you as an architect / engineer.

michaelmcgillivray
Автор

This channel is a pillar of knowledge for people who want to understand infrastructure. It has helped me greatly, thank you for sharing your knowledge.

JamesJSwiftJay
Автор

Terraform has USERDATA, template_file for setting up and running your app too.
So that necessarily fills the void for configuration management which ansible does

Nobo_On_The_Rocks
Автор

Great info from the layman term & a newbies started to know about all these..

MsRen
Автор

Great explanation good job @IBM Technology

davidsalleyezonme
Автор

Can we appreciate how he writes from the other side of the pane? :)

andukz
Автор

unnecessary confusion:
the other video for Ansible stated that it is clearly declarative ... here Ansible is hybrid while Terraform is declarative
Ansible video said A. is good for Provisioning, Config and eventually App deployment ... here Ansible is more for Config and App deployment while Terraform better for Provisioning

khaktus
Автор

I wish to see a complete DevOps course by IBM Cloud engineers/YouTubers/Tutors.

codelucky
Автор

0:41 I usually say, "Terraform is idempotent" which sparks the conversation, "What is that?!" That sets the foundation well. "Declarative" tells only part of the picture. Idempotency isn't mentioned until 6:32, and then in an indirect way re. Ansible modules.

JB-mnff
Автор

great info, im just amazed at the mirrored writing

MisteretsiM
Автор

I got my RHCSA and studying for RHCE now. What positions are most related to these two cert except for Linux admin? I'm looking for a Linux admin position but there are not many.. so i was thinking maybe learning more skills and search for other positions as well!

kihunkim
Автор

How to run the shell scripts in one gofor multiple servers without using ansible..any alternative please

sandeepsahu