Full Download Introduction to Ansible Network Automation: A Practical Primer Brendan Choi PDF DOCX
Full Download Introduction to Ansible Network Automation: A Practical Primer Brendan Choi PDF DOCX
com
https://ebookmass.com/product/introduction-to-ansible-
network-automation-a-practical-primer-brendan-choi-2/
OR CLICK HERE
DOWLOAD NOW
https://ebookmass.com/product/introduction-to-ansible-network-
automation-a-practical-primer-brendan-choi/
ebookmass.com
https://ebookmass.com/product/supply-network-5-0-how-to-improve-human-
automation-in-the-supply-chain-bernardo-nicoletti/
ebookmass.com
https://ebookmass.com/product/slow-living-earthcent-universe-
book-5-e-m-foner/
ebookmass.com
https://ebookmass.com/product/global-business-in-the-age-of-
destruction-and-distraction-mahesh-joshi/
ebookmass.com
https://ebookmass.com/product/formation-evaluation-with-pre-digital-
well-logs-1st-edition-richard-m-bateman/
ebookmass.com
https://ebookmass.com/product/the-promise-of-lost-things-helene-
dunbar/
ebookmass.com
https://ebookmass.com/product/the-wiley-blackwell-companion-to-
theology-and-qualitative-research-1st-edition-knut-tveitereid/
ebookmass.com
Nursing Today: Transition and Trends 11th Edition Joann
Zerwekh
https://ebookmass.com/product/nursing-today-transition-and-
trends-11th-edition-joann-zerwekh/
ebookmass.com
Brendan Choi and Erwin Medina
Erwin Medina
Sydney, NSW, Australia
This work is subject to copyright. All rights are solely and exclusively
licensed by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of
illustrations, recitation, broadcasting, reproduction on microfilms or in
any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or
dissimilar methodology now known or hereafter developed.
The publisher, the authors, and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress
Media, LLC, part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY
10004, U.S.A.
Introduction
The use of Ansible in enterprise network administration has gained
significant popularity among leading IT organizations. It is recognized
as the most effective tool for automating network devices within a short
time frame, revolutionizing the way network administrators manage
their infrastructure. In response to this growing demand, we present
Introduction to Ansible Network Automation: A Practical Primer, a book
that offers readers a structured learning path to build a solid
foundation in Ansible.
Written by real ICT professionals for true ICT professionals,
this book cuts through the fluff and delivers practical knowledge
without false assumptions. We have written this book based on the
assumption that all our readers enjoy working in the ICT industry and
prefer a hands-on learning approach over a purely theoretical one. This
book is not for the faint-hearted but is designed for individuals with an
unwavering “never-say-die” attitude who refuse to give up at work and
in their lives. We aim to provide an authentic experience, taking readers
on the actual journey of acquiring network automation skills using
Ansible from the ground up.
While there are numerous Linux and network Ansible automation
resources available, most of them assume that readers have already
reached an adequate skill level to start writing working YAML code
from day one. These resources rarely show what it takes to reach that
level and often focus solely on selling the dream of Ansible without
discussing the effort and challenges involved. Our book offers a truthful
approach, immersing readers in the journey and allowing them to feel
what it’s like to acquire network automation skills using Ansible. They
will install and configure everything themselves, follow along with the
book, make mistakes, stumble, and ultimately push themselves to learn
the necessary skills to become comfortable with using Ansible
playbooks and YAML scripts.
As you can tell from the title, this book serves as a sequel to
Introduction to Python Network Automation: The First Journey by
Brendan Choi. Both titles are indispensable resources for IT
professionals and students seeking to enhance their automation skills
and apply them in real-world scenarios in enterprise production
networks. This book provides a comprehensive learning journey,
guiding readers to master Ansible and utilize it for automating
enterprise network devices such as routers, switches, firewalls,
Wireless LAN Controllers (WLCs), and Linux servers. What sets this
book apart is its laser-focused emphasis on Linux, Ansible, and network
automation; really, we have squeezed three basic books into one! It is
specifically designed for IT engineers and students who want to get
hands-on experience and build an Ansible Network Automation lab
from scratch. Real-life examples of Ansible playbooks developed from
actual enterprise infrastructure are provided, giving readers a thorough
understanding of how Ansible can be effectively utilized in the real
world.
By engaging with this book, readers will acquire valuable
knowledge and skills in network automation using Ansible. The book
takes readers on a structured learning path, gradually building their
understanding and proficiency in Ansible. Firstly, readers will
develop a comprehensive understanding of Ansible and its
essential concepts for automating network devices. They will learn
how to apply these concepts to real-world scenarios, gaining the skills
required to automate enterprise network devices effectively. Secondly,
readers will master the basics of Ansible operations within Linux
automation and progress to applying Ansible concepts to network
devices. They will establish a solid foundation for network automation
tasks by navigating and utilizing Ansible within the Linux environment.
Thirdly, readers will learn to develop and execute Ansible ad hoc
commands and playbooks for various network operations,
including configuration management, software updates, and
system monitoring. Through practical examples and exercises, readers
will gain hands-on experience in crafting Ansible playbooks to
automate critical network tasks. Next, readers will work with real-
life examples of Ansible playbooks developed from enterprise
infrastructure. This practical experience will enable them to write
Ansible YAML scripts confidently, ensuring they are well prepared to
tackle network automation challenges in real-world environments.
Lastly, readers will acquire the skills necessary to automate
network operations using Ansible in selective scenarios for
enterprise production environments. They will gain insights into
streamlining network management processes and transitioning from
manual tasks to full automation, enhancing efficiency and productivity.
Through the content and exercises provided in this book, readers will
be equipped with the knowledge and skills to effectively apply Ansible
in network automation, empowering them to navigate the ever-
evolving world of network administration with confidence and
proficiency.
We designed this book for diverse readers seeking to enhance their
network automation skills using Ansible. It caters to IT students,
network engineers, and developers managing IP services, networking
devices, servers, cloud, and data centers. Technical leaders
implementing network automation, mentors training team members,
instructors teaching network automation, and Cisco Networking
Academy students pursuing certifications in network administration
will find value in this book. It targets those interested in integrating
network automation into their development process and offers
practical knowledge for a wide readership. By leveraging Ansible,
readers can learn and apply network automation techniques effectively.
Join us on this journey to expand your network automation capabilities
and unlock new possibilities in your work.
Any source code or other supplementary material referenced by the
author in this book is available to readers on GitHub at
https://github.com/Apress/Introduction-to-Ansible-Network-
Automation-by-Brendan-Choi-and-Erwin-Medina. For more detailed
information, please visit https://www.apress.com/gp/services/source-
code.
Acknowledgments
I would like to express my heartfelt gratitude to Ty Starr at Telstra
Purple and Kai Schweisfurth at Ethan Group, my previous team
managers, for providing me with the opportunities to work with my
former teams. Under Ty’s stewardship, I was able to teach myself how
to use Ansible for automation and knowledge share. Similarly, under
Kai’s guidance, I developed a passion for network automation using
Python and eagerly shared my learnings with my colleagues. I would
also like to extend my thanks to my former colleague, Justin Cheong at
Mastercard, who consistently encouraged me to write my first book and
gave me the courage to become a published author. My deepest
appreciation goes to my coauthor, Erwin Medina, for his unwavering
dedication, hard work, and expertise, which greatly contributed to the
completion of this book. I am also grateful to my wife, Sue, and our
children, Hugh, Leah, and Caitlin, for their unwavering support
throughout the process of creating this book. Their love and
understanding have been my pillars of strength. To my extended family,
friends, and colleagues, I would like to express my sincere thanks for
your constant support. Lastly, I want to thank our readers for
embarking on their incredible network automation journey with us.
—Brendan Choi
I cannot express enough thanks to Brendan Choi for continuously
mentoring me and taking me under his wings to go through this
journey. His passion, dedication, and drive to accomplish this book to
primarily teach and inspire serve to be the greatest part for me. He
taught me the valuable lesson of learning, sharing, and inspiring. I
would like to thank my wife, Jenny, and my son, Deon, for their support
and prayers throughout this process. To my friends and colleagues who
have become like family, I extend my heartfelt gratitude. To the readers,
I sincerely thank you, and I hope that this book will provide help and
inspiration as you embark on your journey, just as I was inspired by
Brendan.
—Erwin Medina
Table of Contents
Part I: The Intros
Chapter 1:Is Ansible Good for Network Automation?
1.1 Laying the Foundation
1.2 What Is Ansible?
1.3 What Is Ansible Not?
1.4 Why Ansible?
1.4.1 1000-Foot View of How Ansible Works
1.5 Why Does Ansible Matter to You?
1.6 Starting on the Right Foot, Learning Ansible Effectively
1.6.1 Part 1:Ansible Primer
1.6.2 Part 2:Ansible Concepts
1.6.3 Part 3:Ansible Practical
1.7 Hardware Requirements
1.8 Software Requirements
1.9 Downloading Source Codes
1.10 Summary
Chapter 2:Shall We Linux?(Part 1:The Linux Command Line)
2.1 A Good Reason to Learn Linux
2.2 Linux for Ansible and Network Automation
2.3 What Is Linux?
2.4 Install WSL on Windows 11 to Learn Linux
2.5 vi:The Default Text Editor
2.6 Practice Linux Commands
2.6.1 The Top Ten Essential Linux Commands
2.6.2 cat and tac
2.6.3 touch
2.6.4 mkdir and rmdir
2.6.5 cp and rm
2.6.6 rename and mv
2.6.7 head, tail, and shuf
2.6.8 less and more
2.6.9 ls and dir
2.6.10 sort
2.6.11 tee and nl
2.6.12 grep
2.7 Summary
Chapter 3:Shall We Linux?(Part 2)
3.1 Linux Directory
3.2 Getting to Know Your Linux Better
3.3 Getting Familiar with Linux Processes
3.4 Getting to Know Disk Space in Linux
3.5 Getting Started with Linux User Management
3.6 Controlling Access to Files and Directories in Linux
3.7 Working with Zip Files in Linux
3.8 Downloading Files from the Internet in Linux
3.9 Linux Network Utilities for Troubleshooting
3.10 Keeping Your Linux System Up to Date
3.11 Jack, the Jack Russell:A Regular Expression Quiz
3.12 Summary
Chapter 4:Setting Up an Ansible Learning Environment
4.1 Planning the Ansible Lab Topology
4.2 Installing VMware Workstation on Your PC
4.3 Creating Fedora Virtual Machines
4.4 Creating Ubuntu Virtual Machines
4.5 Customizing and Updating Virtual Machines
4.6 Changing Hostname on Fedora VMs
4.7 Assigning Static IP on Fedora VMs
4.8 Updating Fedora Virtual Machines
4.9 Assigning Static IP on the First Ubuntu VM
4.10 Changing Hostname and Static IP on the Second Ubuntu
VM
4.11 Updating Ubuntu Virtual Machines
4.12 Installing Ansible on Control Node
4.12.1 Option 1:Installing Ansible Directly on the Host OS
4.12.2 Option 2:Installing Ansible on Python virtualenv
4.13 Setting Up a New Ansible Testing Account with Sudo
Access
4.13.1 Creating a Sudo Test Account on Fedora VMs
4.13.2 Creating a Sudo Test Account on Ubuntu VMs
4.14 Summary
Part II: The Concepts
Chapter 5:Understanding Data Types and File Formats for Ansible
5.1 What Are Data and Data Types?
5.2 Ansible Dependency on Python Data Types
5.2.1 Integer and Float
5.2.2 Strings
5.2.3 Booleans
5.2.4 Lists
5.2.5 Tuples
5.2.6 Dictionaries
5.2.7 set
5.2.8 None
5.3 Ansible Configuration Files
5.3.1 INI Format
5.3.2 Ansible Inventory in INI, JSON, and YAML Formats
5.3.3 Ansible Inventory Priority
5.3.4 ansible.cfg File
5.3.5 YAML
5.4 Ansible Data Interchange
5.4.1 JSON (Why Not YANG?)
5.4.2 Jinja2
5.5 Summary
Chapter 6:Learning Ansible Basic Concepts I:SSH and Ad Hoc
Commands
6.1 SSH Overview and Setup in Ansible
6.1.1 Configuring SSH for Ansible:General Steps
6.1.2 Understanding the Ansible SSH Concept
6.1.3 Practical Usage of SSH in Ansible
6.2 Running Ad Hoc Commands on Linux Devices with Ansible
6.3 Running Ad Hoc Commands on Routers and Switches with
Ansible
6.4 Running Elevated Ad Hoc Commands with Ansible
6.5 Summary
Chapter 7:Learning Ansible Basic Concepts II:Ad Hoc Commands –
A Beginner’s Guide
7.1 Summary
Chapter 8:Learning Ansible Basic Concepts II:Using when,
Improving Playbook, and Targeting Nodes
8.1 Considerations Before Writing Your Ansible Playbook
8.2 Creating and Running a New Playbook in Ansible
8.3 Idempotency Is a Key Feature of Ansible Tasks
8.4 Getting Familiar with Ansible Error Messages
8.5 Getting More Information About Ansible Operation Using
the Verbose Mode
8.6 Disabling gather_facts to Speed Up the Playbook
8.7 Adding More Tasks to Your Existing Playbook
8.8 Keeping Packages Always Up to Date Using “state:latest”
8.9 Creating an Uninstall Playbook Using the Existing Playbook
8.10 Add Another OS Type and Use the “when” Conditional in
Your Playbook
8.11 Targeting a Specific Host or Group of Hosts
8.12 Writing a Working Playbook for Both Ubuntu and Fedora
8.13 Refactoring a Playbook
8.14 Ansible, Targeting Specific Nodes
8.15 Check Services from the Control Node
8.16 Printing Output Using Ansible Debug Module
8.17 Using “ignore_errors:yes” to Allow Playbook Completion
Despite Errors
8.18 Install Samba and Create a Samba User on the Fedora
Client Using a Playbook
8.19 Summary
Chapter 9:Learning Ansible Basic Concepts III:Git, Tags, Managing
Files, and Services
Getting Started with GitHub
9.1 Creating and Uploading Playbooks to GitHub, Featuring
cowsay
9.2 Ansible Tags Explained
9.3 Managing Files
9.4 Managing Services
9.5 Copying and Updating Text Files with Ansible Playbook
9.6 Use GitHub to Back Up Your Files
9.7 Summary
Chapter 10:Learning Ansible Basic Concepts IV:Users, Roles, Host
Variables, Templates, and Password Vault
10.1 Users
10.2 Roles
10.3 Variable Options in Ansible
10.4 host_vars and handler
10.4.1 Concept of the Handler in Ansible
10.5 Templates
10.6 Managing Password on Ansible
10.6.1 Password Vault
10.7 Summary
Chapter 11:Building an Ansible Learning Environment for
Network Automation
11.1 Cisco CML (Cisco Modeling Labs) Router and Switch
Installation on GNS3
11.2 Palo Alto and Fortinet Firewall Installation on GNS3
11.2.1 Palo Alto PA-VM Initial Configuration and Connection
Test
Another Random Document on
Scribd Without Any Related Topics
VII.
Roma saapui kotiin ilon huumaamana. Hän tiesi, että Rossi tulisi
hänen luokseen hänen käskystään. Heidän täytyi yhdessä syödä
päivällistä tänään. Kaikki kellot ulkona löivät nyt seitsemän, ja
antaakseen Rossille aikaa tulla määräsi hän päivällisen kello
kahdeksaksi. Kreivitär tahtoi syödä omassa huoneessaan, ja siis
Roma ja Rossi saivat olla kahdenkesken. Roma ei ollenkaan enää
välittänyt seuraelämän säännöistä.
Mutta kun ovi aukeni, astuikin huoneeseen paroni Bonelli. Hän oli
iltapuvussa, kaulassa musta kravatti ja mustat paidannapit rinnassa.
Hän näytti kylmältä ja tyyneltä kuten tavallista.
»Sinä et siis ole kertonut hänelle?» sanoi paroni niin hiljaa, että
tuskin saattoi kuulla hänen sanojaan.
»Totuutta.»
»Minun silmissäni sinä olet suloinen ja hyvä, mutta entä toisen, jos
hän tietää? Kun mies aikoo ottaa naisen vaimokseen, on olemassa
yksi seikka, jota hän ei koskaan anna anteeksi. Täytyykö minun
sanoa, mikä se on? Ei auta vakuuttaa hänelle, että naisen sydän on
puhdas — että hänen tahtonsa silloin oli lamautunut. Joko — tahi…
muuta mies ei kysy.»
»Tekö tuota sanotte minulle?» kysyi hän. »Te! te! Eikö nainen
koskaan saa unohtaa? Täytyykö toisen synnin seurata häntä koko
hänen elinaikansa? Se on julmaa! Se on armotonta… Mutta mitäpä
siitä!» lisäsi hän toisella äänellä. Ja kääntyen pois paronista hän
sanoi melkein itsekseen: »Hän uskoo kaiken mitä sanon hänelle.
Miksi surisin?»
»Mitä kukaan voisi hänelle kertoa, jota hän ei jo ole kuullut? Hän
on kuullut kaiken eikä ole siitä välittänyt.»
Hän vaikeni ymmärtäen äkkiä, mitä hän nyt teki. Hän rukoili
rakastettunsa henkeä tämän viholliselta, joka sanoi rakastavansa
häntä.
»Minä voin kertoa hänelle, että luonnon ja järjen lain mukaan olet
minun omani», sanoi paroni.
»Etkö ole ajatellut sitä?» sanoi paroni. »Jos tuo mies suostuu
kaksintaisteluun, puolustaa hän sitä, mitä olet kertonut hänelle.
Sokeassa uskossa sinun sanoihisi hän on valmis uhraamaan
elämänsä.
Aiotko sinä antaa hänen taistella valheen tähden?»
Roma peitti kasvonsa käsillään.
»Eiväthän asiat nyt ole niin pahat kumminkaan. Mutta ellei tuo
avioliitto ole mahdollinen ilman niitä seurauksia, joista puhuin, on
parempi, ettei siitä tule mitään. Lykkää se tuonnemmaksi. Älä sure
sitä, että kuulutus on julaistu. Avioliiton voi solmia milloin tahansa
sadan ja kahdeksankymmenen päivän kuluessa. Ennen parlamentin
loppua tuo mies vangitaan ja laki tekee tehtävänsä. Jätä loput ajan
huostaan. Aika parantaa kaikki meidän pienet sydänkipumme,
lapseni!»
Roman takana pääministeri, joka pyysi anteeksi, että hän oli näin
yht'äkkiä muuttanut tämän talon sisäasiainministeriöksi, puheli
poliisipäällikön kanssa.
»Olemme.»
»Ainoastaanko miehiä?»
»Entä sitten?»
»Hyvä!»
Silloin tyttö nosti hänet syliinsä ja kantoi häntä, kun taas Giuseppe
kantoi sauvaansa, ja hetken ajan molemmat olivat tyytyväisiä. Mutta
kun he saapuivat Via Tritonelle, huusi joku: »Halloo, tuolla tulee
pyhä lapsukainen», ja silloin Giuseppe taas tunsi arvonsa loukatuksi
ja tahtoi maahan.
Sitten hän muisti äitiään, ja pikku huuli venyi pitkäksi. Mutta hän
hymyili taas ajatellessaan, että tietysti äiti tuli joka ilta viemään
hänet levolle, kuten ennenkin. »Hyvää yötä, äiti, huomiseen asti»,
hän sanoi aina, ja kun hän aukaisi silmänsä, oli aamu.
*****
»Ja minä aioin antaa hänelle vitsaa», sanoi Elena. »Vielä minuuttia
ennen minä puhuin vitsasta ja siitä, etten antaisi hänelle illallista.
Hyvä Jumala! En voi koskaan antaa anteeksi itselleni.»
»Haudat jo halkee
Kuolleitten.
Nousevat haamut
Marttyyrien.»
Elena oli tyynempi nyt. Hän istui lapsen vieressä silitellen sen
kylmää kättä.
Davido Rossi, joka tuskin oli puhunut sanaakaan, meni
makuuhuoneeseensa. Hänen huulensa olivat tiiviisti
kokoonpuristuneet, silmät veristyneet ja hengitys raskas ja
vaivalloinen. Epätoivoisen miehen raivo oli kamala.
»Katsokaas!» sanoi Elena, kun Rossi kulki ruokasalin läpi. Äiti oli
kääntänyt nurin pojan taskut ja itki nähdessään hänen pienet
aarteensa — siellä oli korkki, kivi, ruostunut naula ja rautalangan
pätkä.
»En viivy kauan», sanoi hän. Hänen äänessään oli jotain, joka sai
Elenan kohottamaan katseensa, ja Rossi näytti vieraalta kuin vallan
toinen ihminen.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookmass.com