Original source: Outshift by Cisco
This video from Outshift by Cisco covered a lot of ground. 4 segments stood out as worth your time. Everything below links directly to the timestamp in the original video.
Understanding the differences between Ansible and Terraform is crucial for organisations looking to streamline their IT operations and choose the right tool for managing their infrastructure.
Ansible and Terraform Offer Distinct Approaches to Infrastructure Automation
Ansible and Terraform, two prominent tools in infrastructure automation, differ significantly in their design and application. Ansible is open-source, procedural, and Python-based, primarily used for configuration management without maintaining a state file. In contrast, Terraform, which operates under a business source license, is declarative, Go-based, and specifically designed for infrastructure provisioning, crucially maintaining a state file that tracks all configurations.
Cisco actively supports both platforms, offering extensive collections for Ansible and official providers for Terraform. This dual support ensures that enterprises can leverage their preferred tool for automation, with Cisco committed to ongoing development and technical assistance for both solutions, addressing bugs and feature requests to meet evolving needs.
"Cisco is committed to both of them. We have actually a bunch of collections for Ansible... They're actively being developed and supported, right?"
Ansible Scaling Challenges Drive Adoption of Terraform and Nornir Alternatives
Organizations are increasingly encountering scaling limitations with Ansible as playbooks grow in size and the number of managed devices increases, leading to significantly longer execution times. This performance bottleneck is prompting many to seek alternative solutions for large-scale infrastructure automation.
Among the alternatives, Terraform is gaining traction for its performance improvements in large environments, offering a more efficient approach to scaling. Another option, Nornir, provides a Python-based framework for network automation, though it requires users to develop their own Python code, making it suitable for teams with strong programming capabilities.
"As you'll see as your playbooks get larger and you have more devices, it's going to take much longer to run those playbooks and configure those devices."
Cisco Offers Feature Parity for Terraform and Ansible to Meet Enterprise Needs
Cisco maintains robust support for both Terraform and Ansible, offering enterprises flexibility to choose the automation tool that best fits their existing infrastructure and expertise. Despite perceived overlaps in functionality, Cisco ensures that its collections for Ansible and providers for Terraform have achieved feature parity, meaning both tools offer comparable capabilities for managing Cisco products.
This strategic approach allows companies already invested in either Terraform or Ansible to continue leveraging their current automation frameworks without needing to adopt a new tool. Cisco's commitment to full support for both platforms reflects a recognition that different organizations have distinct operational preferences and existing technology stacks.
"It's pretty much feature parity between Ansible collections and Terraform providers. It's fully supported."
Terraform Emerges as Declarative Provisioning Tool with Business Source License
Terraform, a provisioning tool from HashiCorp, operates under a business source license, distinguishing it from open-source alternatives like OpenTofu. It is designed for infrastructure provisioning, initially focusing on cloud deployments but expanding its reach to servers and network hardware. Terraform is characterized by its declarative and stateful nature, allowing users to define the desired state of their infrastructure without specifying the exact steps to achieve it, and it meticulously maintains a state file of all configurations.
The tool utilizes HashiCorp Configuration Language (HCL), a domain-specific language that resembles JSON, to interact primarily with REST APIs. Crucially, Terraform does not demand programming expertise, though understanding concepts like loops and conditionals can enhance its application. This design allows users to specify an outcome, such as enabling OSPF, and the Terraform provider handles the underlying sequence of commands.
"With Terraform you just tell Terraform I want my infrastructure to look like this. I don't care how you make it happen. Go and make it happen."
Also mentioned in this video
- Infrastructure as Code is defined as managing and provisioning computing… (2:06)
- Ansible is introduced as an open-source, agentless push model automation and… (3:19)
- Ansible's architecture includes a platform for installation, an engine… (5:10)
- Starting with Ansible involves installing it in a virtual environment using… (6:46)
- Ansible collections, introduced with Ansible 2.9, decouple vendor capabilities… (7:55)
- Collections are aggregations of Ansible modules, which are simple tasks for… (9:25)
- Best practices for Ansible modules include using fully qualified domain names… (11:39)
- Ansible best practices for scaling include organizing files into folders for… (13:02)
- Using an Integrated Development Environment (IDE) like VS Code or PyCharm is… (14:46)
- Ansible roles are crucial for reusability, combining multiple modules into a… (15:37)
- Ansible playbooks define actions using roles like `OSPF_config` and reference… (17:33)
- For security, environment variables or Vault should be used for credentials… (18:43)
- Combining playbooks, roles, inventory, and group variables allows for… (20:25)
- Terraform is a CLI application, with the latest version 1.14.4, installable on… (26:26)
- Terraform providers are crucial components that enable interaction with… (27:10)
- Terraform configuration involves specifying the required Terraform and provider… (30:00)
- Terraform plans, written in HCL with a .tf extension, define actions to… (32:07)
- File (.tfstate) that tracks all built objects, typically stored in a central,… (35:05)
- For brownfield environments, Terraform allows importing existing infrastructure… (35:54)
- Terraform variables are simpler than Ansible's, definable via CLI, .tfvars… (37:38)
- Key Terraform commands include `terraform init` to download providers and… (38:37)
- Cisco is committed to both Ansible and Terraform, with numerous collections and… (43:02)
- Next steps for new users include installing both tools, starting with small… (43:53)
Summarised from Outshift by Cisco · 47:16. All credit belongs to the original creators. Streamed.News summarises publicly available video content.