Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Network Automation Cookbook

You're reading from   Network Automation Cookbook Over 100 recipes to effectively configure and manage network infrastructure with Ansible

Arrow left icon
Product type Paperback
Published in Aug 2025
Publisher Packt
ISBN-13 9781835887981
Length 566 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Christian Adell Christian Adell
Author Profile Icon Christian Adell
Christian Adell
Jeffrey Kala Jeffrey Kala
Author Profile Icon Jeffrey Kala
Jeffrey Kala
Karim Okasha Karim Okasha
Author Profile Icon Karim Okasha
Karim Okasha
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1: Getting Started with Ansible
2. Why Ansible for Network Automation? FREE CHAPTER 3. Building Blocks of Ansible 4. Advanced Ansible Concepts 5. Part 2: Managing Network Infrastructure with Ansible
6. Building Data Center Networks with Arista 7. Automating a Juniper Network Core Using Ansible 8. Managing Nokia SR Devices Using Ansible 9. Administering a Multi-Vendor Network with NAPALM and Ansible 10. Part 3: Managing Cloud Networking with Ansible
11. Deploying and Operating AWS Networking 12. Deploying and Operating Azure Networking 13. Deploying and Operating GCP Networking 14. Part 4: Integrating Ansible
15. Network Validation with Batfish 16. Building a Network Inventory with Nautobot 17. Simplifying Automation with AWX 18. Event-Driven Automation with Ansible 19. Terraform and Ansible Dancing Together 20. Index
21. Other Books You May Enjoy
Appendix - The Lab

Generating configurations using Nautobot

In this final recipe of the chapter, you will use the dynamic inventory from the previous section and enrich it with more data from Nautobot to render configuration snippets for all data center network devices:

  1. Create a new Ansible playbook, pb_build_config.yml, with one task to define two variables: graph_variables and query_string. The first contains the name of the network device, and the second is a GraphQL query string that will retrieve the interface’s name, description, IP address, and status to render the configuration:
    root@cookbook-lab:~/cookbook-lab/chapters/ch12/dynamic_inventory# vi pb_build_config.yml
    ---
    - name: Create Interface Configuration Snippets
      hosts: all
      gather_facts: no
      connection: local
      vars:
        nautobot_url: http://127.0.0.1:8080
        nautobot_token: 47a72c0b6b7a9c70c07501625a77fd398de59d1c...
lock icon The rest of the chapter is locked
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Network Automation Cookbook
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon