Chapter 3 How to Automate the Network?

For diagrams, tables, or exact code formatting, .

JOHN W. CAPOBIANCOPRINTED PAGE 49

https://code.visualstudio.com/ Linux

A flavor of Linux is required in the environment to host the Ansible installation. Linux may be new or there might be an existing Linux footprint in the enterprise. The Linux machine where Ansible is installed requires the ability resolve the hostnames, as well as SSH into, all the network devices. The Linux host needs to communicate with the TFS server through TCP port 8080 or 8443 to perform Git operations such as cloning the repository to the Linux host. Using Git, updates from the repository on the TFS server can be pulled down and output from Ansible playbooks can be pushed up into the repository on the TFS server. RBAC should be implemented and standard best practices for server installation (apply updates, harden the system) followed as the Linux host will become a central component of the automation engine. All Ansible playbooks are executed from this Linux host and as such, precautions should be taken to protect this system from unauthorized access.

Traditional Linux

Ansible can run on any Red Hat Enterprise Linux (TM), CentOS, Fedora, Debian, or Ubuntu system.

On Fedora:

$ sudo dnf install ansible

On RHEL and CentOS:

$ sudo yum install ansible On Ubuntu: $ sudo apt-get update $ sudo apt-get install software-properties-common $ sudo apt-add-repository --yes --update ppa:ansible/ansible $ sudo apt-get install ansible A detailed installation guide can be found here: https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html Linux on Windows 10 The Linux requirement should not deter the organization from pursuing Ansible. The enterprise may not support Linux, the network team may not be very familiar with Linux, or it may be a purely Microsoft shop. Linux on Windows is a relatively new supported feature from Microsoft however Ansible has been proven to run under Windows using the latest version of Windows Subsystems for Linux (WSL) and the Ubuntu distribution.

First install WSL. Open the “Control Panel”.