Network Automation Cookbook: Proven and actionable recipes to automate and manage network devices using Ansible
Book information
Description
Take your network automation skills to the next level with practical recipes on managing network devices from a variety of vendors like Cisco, Juniper, and Arista Key Features Use Ansible to automate network infrastructure with the help of step-by-step instructions Implement network automation best practices to save cost, avoid critical errors, and reduce downtime Deliver a robust automation framework by integrating Ansible with NAPALM, NetBox, and Batfish Book Description Network Automation Cookbook is designed to help system administrators, network engineers, and infrastructure automation engineers to centrally manage switches, routers, and other devices in their organization's network. This book will help you gain hands-on experience in automating enterprise networks and take you through core network automation techniques using the latest version of Ansible and Python. With the help of practical recipes, you'll learn how to build a network infrastructure that can be easily managed and updated as it scales through a large number of devices. You'll also cover topics related to security automation and get to grips with essential techniques to maintain network robustness. As you make progress, the book will show you how to automate networks on public cloud providers such as AWS, Google Cloud Platform, and Azure. Finally, you will get up and running with Ansible 2.9 and discover troubleshooting techniques and network automation best practices. By the end of this book, you'll be able to use Ansible to automate modern network devices and integrate third-party tools such as NAPALM, NetBox, and Batfish easily to build robust network automation solutions. What you will learn Understand the various components of Ansible Automate network resources in AWS, GCP, and Azure cloud solutions Use IaC concepts to design and build network solutions Automate network devices such as Cisco, Juniper, Arista, and F5 Use NetBox to build network inventory and integrate it with Ansible Validate networks using Ansible and Batfish Who this book is for This Ansible network automation book is for network and DevOps engineers interested in automating complex network tasks. Prior understanding of networking and basic Linux knowledge is required. Cover Title Page Copyright and Credits About Packt Contributors Table of Contents Preface Chapter 1: Building Blocks of Ansible Technical requirements Installing Ansible Getting ready How to do it... How it works.. How it works... See also... Building Ansible's inventory Getting ready How to do it... How it works... Using Ansible's variables Getting ready How to do it... How it works... There's more... Building Ansible's playbook Getting ready How to do it... How it works... Using Ansible's conditionals Getting ready How to do it... How it works... See also... Using Ansible's loops Getting ready How to do it... How it works.. See also... Securing secrets with Ansible Vault How to do it... How it works.. There's more... Using Jinja2 with Ansible Getting ready How to do it... How it works... See also... Using Ansible's filters How to do it... How it works... Using Ansible Tags How to do it... How it works... See also... Customizing Ansible's settings How to do it... How it works... See also... Using Ansible Roles How to do it... How it works... See also Chapter 2: Managing Cisco IOS Devices Using Ansible Technical requirements Building an Ansible network inventory Getting ready How to do it... How it works... Connecting to Cisco IOS devices Getting ready How to do it... How it works... There's more... Configuring basic system information Getting ready How to do it... How it works... See also... Configuring interfaces on IOS devices Getting ready How to do it... How it works... See also... Configuring L2 VLANs on IOS devices Getting ready How to do it... How it works... Configuring trunk and access interfaces Getting ready How to do it... How it works... See also... Configuring interface IP addresses Getting ready How to do it... How it works... See also... Configuring OSPF on IOS devices Getting ready How to do it... How it works... Collecting IOS device facts Getting ready How to do it... How it works... There's more... See also... Validating network reachability on IOS devices Getting ready How to do it... How it works... Retrieving operational data from IOS devices Getting ready How to do it... How it works... Validating network states with pyATS and Ansible Getting ready How to do it... How it works... See also... Chapter 3: Automating Juniper Devices in the Service Providers Using Ansible Technical requirements Building the network inventory Getting ready How to do it... How it works... Connecting and authenticating to Juniper devices Getting ready How to do it... How it works... There's more... Enabling NETCONF on Junos OS devices Getting ready How to do it... How it works... Configuring generic system options on Juniper devices Getting ready How to do it... How it works... There's more... See also... Configuring interfaces on Juniper devices Getting ready How to do it... How it works... There's more... Configuring OSPF on Juniper devices How to do it... How it works... Configuring MPLS on Juniper devices How to do it... How it works... Configuring BGP on Juniper devices How to do it... How it works... Deploying configuration on Juniper devices Getting ready How to do it... How it works... There's more... See also... Configuring the L3VPN service on Juniper devices Getting ready How to do it... How it works... See also... Gathering Juniper device facts using Ansible Getting ready How it works... See also... Validating network reachability on Juniper devices Getting ready How to do it... How it works... See also... Retrieving operational data from Juniper devices Getting ready How to do it... How it works... There's more... Validating the network state using PyEZ operational tables Getting ready How to do it... How it works... See also... Chapter 4: Building Data Center Networks with Arista and Ansible Technical requirements Building the Ansible network inventory Getting ready How to do it... How it works... Connecting to and authenticating Arista devices from Ansible Getting ready How to do it... How it works... Enabling eAPI on Arista devices Getting ready How to do it... How it works... See also... Configuring generic system options on Arista devices Getting ready How to do it... How it works... There's more... Configuring interfaces on Arista devices Getting ready How to do it... How it works... There's more... See also... Configuring the underlay BGP on Arista devices Getting ready How to do it... How it works... Configuring the overlay BGP EVPN on Arista devices Getting ready How to do it... How it works... Deploying the configuration on Arista devices Getting ready How to do it... How it works... See also... Configuring VLANs on Arista devices Getting ready How to do it... How it works... See also... Configuring VXLANs tunnels on Arista devices Getting ready How to do it... How it works... Gathering Arista device facts Getting ready How to do it... How it works... See also... Retrieving operational data from Arista devices Getting ready How to do it... How it works... See also... Chapter 5: Automating Application Delivery with F5 LTM and Ansible Technical requirements Building an Ansible network inventory Getting ready How to do it... How it works... Connecting and authenticating to BIG-IP devices Getting ready How to do it... How it works... There's more... Configuring generic system options on BIG-IP devices Getting ready How to do it... How it works... Configuring interfaces and trunks on BIG-IP devices Getting ready How to do it... How it works... See also... Configuring VLANs and self-IPs on BIG-IP devices Getting ready How to do it... How it works... See also... Configuring static routes on BIG-IP devices Getting ready How to do it... How it works... Deploying nodes on BIG-IP devices Getting ready How to do it... How it works... Configuring a load balancing pool on BIG-IP devices Getting ready How to do it... How it works... See also... Configuring virtual servers on BIG-IP devices Getting ready How to do it... How it works... See also... Retrieving operational data from BIG-IP nodes Getting ready How to do it... How it works... There's more... See also... Chapter 6: Administering a Multi-Vendor Network with NAPALM and Ansible Technical requirements Installing NAPALM and integrating with Ansible Getting ready How to do it... How it works… Building an Ansible network inventory How to do it… How it works… Connecting and authenticating to network devices using Ansible Getting ready How to do it… How it works… Building the device configuration Getting ready How to do it… How it works… Deploying configuration on network devices using NAPALM Getting ready How to do it… How it works… There's more… Collecting device facts with NAPALM Getting ready How to do it… How it works… See also… Validating network reachability using NAPALM Getting ready How to do it… How it works… Validating and auditing networks with NAPALM Getting ready How to do it… How it works… See also… Chapter 7: Deploying and Operating AWS Networking Resources with Ansible Technical requirements Installing the AWS SDK Getting ready How to do it... How it works... Building an Ansible inventory How to do it... How it works... Authenticating to your AWS account Getting ready How to do it... How it works... Deploying VPCs using Ansible Getting ready How to do it... How it works... See also Deploying subnets using Ansible Getting ready How to do it... How it works... See also Deploying IGWs using Ansible Getting ready How to do it... How it works... See also Controlling routing within a VPC using Ansible Getting ready How to do it... How it works... See also Deploying network ACLs using Ansible Getting ready How to do it... How it works... See also Deployment validation using Ansible Getting ready How to do it... How it works... See also Decommissioning resources on AWS using Ansible Getting ready How to do it... How it works... Chapter 8: Deploying and Operating Azure Networking Resources with Ansible Technical requirements Installing the Azure SDK Getting ready How to do it… How it works… See also… Building an Ansible inventory How to do it… How it works… Authenticating to your Azure account Getting ready How to do it… How it works… See also… Creating a resource group Getting ready How to do it… How it works... See also... Creating virtual networks Getting ready How to do it... How it works... See also... Creating subnets Getting ready How to do it... How it works... See also... Building user-defined routes Getting ready How to do it... How it works... See also... Deploying network security groups Getting ready How to do it... How it works... See also... Deployment validation using Ansible Getting ready How to do it... How it works... See also... Decommissioning Azure resources using Ansible Getting ready How to do it... How it works... Chapter 9: Deploying and Operating GCP Networking Resources with Ansible Technical requirements Installing the GCP SDK Getting ready How to do it... How it works... See also... Building an Ansible inventory How to do it... How it works... Authenticating to your GCP account Getting ready How to do it... How it works... There's more... See also... Creating GCP VPC networks Getting ready How to do it... How it works... There is more... See also... Creating subnets Getting ready How to do it... How it works... See also... Deploying firewall rules in GCP Getting ready How to do it... How it works... See also... Deploying VMs in GCP Getting ready How to do it... How it works... See also... Adjusting routing within a VPC Getting ready How to do it... How it works.. See also... Validating GCP deployment using Ansible Getting ready How to do it... How it works... See also... Decommissioning GCP resources using Ansible Getting ready How to do it... How it works... Chapter 10: Network Validation with Batfish and Ansible Technical requirements Installing Batfish Getting ready How to do it... How it works… See also... Integrating Batfish with Ansible Getting ready How to do it… How it works… See also... Generating the network configuration Getting ready How to do it... How it works... Creating a network snapshot for Batfish Getting ready How to do it... How it works… See also... Initializing the network snapshot with Ansible Getting ready How to do it... How it works... Collecting network facts from Batfish Getting ready How to do it... How it works... There's more... See also... Validating traffic forwarding with Batfish Getting ready How to do it... How it works... Validating ACLs with Batfish Getting ready How to do it… How it works… Chapter 11: Building a Network Inventory with Ansible and NetBox Technical requirements Installing NetBox Getting ready How to do it… How it works… There's more See also... Integrating NetBox with Ansible Getting ready How to do it… How it works… See also... Populating sites in NetBox Getting ready How to do it… How it works… See also... Populating devices in NetBox Getting ready How to do it... How it works… See also... Populating interfaces in NetBox Getting ready How to do it… How it works… See also... Populating IP addresses in NetBox Getting ready How to do it… How it works… See also... Populating IP prefixes in NetBox Getting ready How to do it… How it works… See also... Using NetBox as a dynamic inventory source for Ansible Getting ready How to do it… How it works… There's more See also... Generating a configuration using NetBox Getting ready How to do it… How it works… Chapter 12: Simplifying Automation with AWX and Ansible Technical requirements Installing AWX Getting ready How to do it… How it works… There's more... See also... Managing users and teams on AWX Getting ready How to do it… How it works… See also... Creating a network inventory on AWX Getting ready How to do it… How it works… Managing network credentials on AWX Getting ready How to do it… How it works… See also... Creating projects on AWX Getting ready How to do it… How it works… See also... Creating templates on AWX Getting ready How to do it… How it works… See also... Creating workflow templates on AWX Getting ready How to do it… How it works… See also... Running automation tasks using the AWX API Getting ready How to do it… How it works… There's more… See also... Chapter 13: Advanced Techniques and Best Practices for Ansible Technical requirements Installing Ansible in a virtual environment Getting ready How to do it... How it works... Validating YAML and Ansible playbooks Getting ready How to do it... How it works... There's more... See also... Calculating the execution time for Ansible playbooks How to do it... How it works... See also... Validating user input using Ansible How to do it... How it works... Running Ansible in check mode How to do it... How it works... There's more... See also... Controlling parallelism and rolling updates in Ansible How to do it... How it works... See also... Configuring fact caching in Ansible How to do it... How it works... There's more... See also... Creating custom Python filters for Ansible How to do it... How it works... There's more... Other Books You May Enjoy Index
Similar books
Network Automation Cookbook: Proven and actionable recipes to automate and manage network devices using Ansible
2020 · PDF
Network Automation Cookbook: Proven and actionable recipes to automate and manage network devices using Ansible
2020 · EPUB
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF