Network Automation with Ansible

Years ago, the standard practice was to configure every single network device by hand. This was possible mainly because the routers and switches were routing the traffic of physical servers, so not much configuration was needed on each networking device, and changes were slow-paced. In addition, humans were the only ones to have enough information on machines to set up networking. Everything was very manual in terms of both planning and execution.

Virtualization changed this paradigm, as it has resulted in thousands of machines being connected to the same switch or router, each with potentially different networking requirements. Changes are fast-paced and expected frequently, and with virtual infrastructures defined in code, it becomes a full-time job for a human administrator to just keep up with the changes to the infrastructure. Virtualization orchestration platforms have far better knowledge of the machine's location, and can even generate an inventory for us, as we saw in earlier chapters. Practically speaking, there is no way a human being can memorize or manage a modern, large-scale, virtualized infrastructure. As a result, it becomes clear that automation is a requirement when it comes to configuring the network infrastructure.

We will learn more about this, and what we can do to automate our network, in this chapter by covering the following topics:

  • Why automate network management?
  • How Ansible manages networking devices
  • How to enable network automation
  • The available Ansible networking modules
  • Connecting to network devices
  • Environment variables for network devices
  • Custom conditional statements for networking devices

Let's get started!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset