Network Automation with Python and Ansible

  • Contact Us For Pricing
  • Reviews star_rate star_rate star_rate star_rate star_half 1115 Ratings
  • Course Code ALTA3-PA
  • Duration 5 days
  • Available Formats Classroom

No two networks are the same! Learn to automate your network with a Python and Ansible skillset. Course can be taught across all major (and most minor) network vendors. Course demonstrations can be adapted to best-fit the customer’s network to ensure all lessons have maximum relevance.

Skills Gained

This course teaches students to blend Python skillsets with Ansible through the lens of automating networks. Automation techniques for the most popular vendors (incl. Cisco, Juniper, Arista) will be subjects of study, however students may request examples from vendors within their own environments. Topics begin with a focus on automating networks with Python. This skill set is then folded into a broadening understanding of automating with Ansible. By the conclusion of this course, Students will have programmatic experience automating enterprise class networks, including writing custom Ansible modules with Python.

Who Can Benefit

Class is appropriate for those interested in automation, specifically network automation, and those looking to marry a Python and Ansible skill-set.

  • Network Administrators
  • Ansible devs
  • Python devs
  • Administrators interested in Automation
  • Individuals interested in devops, specifically for networking

Prerequisites

  • Recommended Prerequisite: Python Basics (5 days)

Course Details

Follow-on Courses

  • Recommended Follow up: Python for Network Automation (5 days)

Day 01

Morning – Critical Python Catch Up & Review

  • Overview of Python and Ansible
  • Python whitespace rules & best practices
  • Conditional expressions
  • Relational and Boolean operators
  • Lists, Tuples, Dictionaries
  • Indexing and slicing
  • Built-in functions
  • Writing custom functions
  • Getting at methods
  • Iterating with Loops (for and while)
  • Working with files
  • Software Control Management (SCM) (Git, Github, Bitbucket, Cloudshare, etc.)
  • Getting at RESTful interfaces with Python
  • Working with JSON
  • Python, Ansible and Paramiko
  • Using Paramiko to SSH with keys and passwords

Day 02

Morning – Python and Network Automation

  • RESTful API review
  • API keys
  • Paramiko Review
  • Using Paramiko to SFTP with keys and passwords
  • Introduction to Netmiko (automating routers and switches)
  • Using Netmiko to send commands to / from network devices
  • Working with YAML
  • Converting JSON to YAML with Python

Day 03

Morning – Critical Ansible Catchup & Review

  • Ansible keywords
  • YAML and JSON for data exchange
  • Ansible and YAML
  • Ansible Playbook components
  • Tying together Python and Ansible – Using Python within Ansible
  • Ansible Network Modules
  • What is new in Ansible (most current updates / release notes)
  • Network Agnostic modules
  • Writing network playbooks
  • Reviewing the construction of network playbooks
  • Writing Ansible playbooks that respond to network failures

Day 04

Morning – Blending Python and Ansible Skillsets

  • Review how to use Python within Ansible
  • Calling Python scripts with Ansible
  • Jinja2 Templating Engine for Python (and Ansible)
  • Using Templates in Ansible playbooks
  • Jinja2 filters, looping, and other useful tricks for automating with Ansible
  • Playbook tagging for selective runs
  • When to use Python and when to use Ansible
  • “Big Picture” options for using Python & Ansible within your Network
  • Ansible Roles
  • Extending Ansible to support Palo Alto (Optional - Case Study)
  • Extending Ansible to support Juniper vendor modules (Optional - Case Study)
  • Extending Ansible to support NAPALM (Optional - Case Study)

Day 05

Morning – Customizing Ansible with Python

  • Review – Running Scripts with Ansible
  • Prompting for Ansible user input
  • Ansible Galaxy & Getting at Roles
  • Writing a custom Ansible Module with Python
  • Ansible “Engine” vs Ansible “Tower” – marketing hype, capabilities, costs, etc.
  • Case Study: Automate your Enterprise Network
  • When to use Python and when to use Ansible
  • Writing your own Ansible modules in Python
  • “Big Picture” options for using Python & Ansible within your Network
  • Overview - NETCONF / YANG and what they mean for Python and Ansible
  • Molecule – Testing your roles

Labs

  • 1. Using vim
  • 2. Using & Installing Python
  • 3. Making a Github account
  • 4. Data within mixed lists
  • 5. Understanding More about Lists
  • 6. Python Dictionaries
  • 7. Getting dir(obj) help() and pydoc
  • 8. Copying Files and Folders
  • 9. Moving and Renaming Files and Folders
  • 10. IPv4 Testing with if
  • 11. Paramiko - SSH with RSA Keys
  • 12. Paramiko - SFTP with UN and PW
  • 13. Space APIs the Final Frontier
  • 14. More APIs - Final Frontier is Vast
  • 15. Interaction with APIs - NASA 01
  • 16. Interaction with APIs - NASA 02
  • 17. Install GNS3
  • 18. Setup for GNS networking
  • 19. Configure the Switches
  • 20. Running Netmiko
  • 21. Running your first Playbook
  • 22. Debug Module
  • 23. Playbook Prompts
  • 24. register and when
  • 25. EOS Get Config and Archive
  • 26. Agnostic Network Modules
  • 27. Network Playbook Error Handling
  • 28. Network Playbook Precheck
  • 29. Network Playbooks with Roles and Rollbacks
  • 30. Securing Playbooks with Vault
  • 31. Network Playbooks, Set Fact, and Fail
  • 32. Debug, Loops, and YAML Lists
  • 33. Running a script with Ansible
  • 34. Jinja Filters
  • 35. Ansible, Python Methods, and Jinja Filters
  • 36. Ansible and APIs
  • 37. Python and Ansible
  • 38. Writing an Ansible Module with Python
  • 39. AWX Tower
  • 40. Molecule – Testing Roles

When does class start/end?

Classes begin promptly at 9:00 am, and typically end at 5:00 pm.

Does the course schedule include a Lunchbreak?

Lunch is normally an hour long and begins at noon. Coffee, tea, hot chocolate and juice are available all day in the kitchen. Fruit, muffins and bagels are served each morning. There are numerous restaurants near each of our centers, and some popular ones are indicated on the Area Map in the Student Welcome Handbooks - these can be picked up in the lobby or requested from one of our ExitCertified staff.

How can someone reach me during class?

If someone should need to contact you while you are in class, please have them call the center telephone number and leave a message with the receptionist.

What languages are used to deliver training?

Most courses are conducted in English, unless otherwise specified. Some courses will have the word "FRENCH" marked in red beside the scheduled date(s) indicating the language of instruction.

What does GTR stand for?

GTR stands for Guaranteed to Run; if you see a course with this status, it means this event is confirmed to run. View our GTR page to see our full list of Guaranteed to Run courses.

Does ExitCertified deliver group training?

Yes, we provide training for groups, individuals and private on sites. View our group training page for more information.

Does ExitCertified deliver group training?

Yes, we provide training for groups, individuals, and private on sites. View our group training page for more information.

The course is perfectly designed with material and labs to get hands on experience on AWS, nicely done!

Very detailed training.Effective for Devops with cloud responsibilities.The Tech explanation and lab is very informative.

It would be better if the classroom had two power point screens so the instructor could have two screens shown to the class at the same time to reduce confusion switching back and forth

Great overview of the AWS architecture. It covered most of the products and building blocks to design in AWS.

The software installation instructions needs to be more clear. We spent a lot time on installing and setting up the environment.

0 options available

There are currently no scheduled dates for this course. If you are interested in this course, request a course date with the links above. We can also contact you when the course is scheduled in your area.

Contact Us 1-800-803-3948
Contact Us Live Chat
FAQ Get immediate answers to our most frequently asked qestions. View FAQs arrow_forward