Skip to Content
可编程网络自动化
book

可编程网络自动化

by Jason Edelman, Scott S. Lowe, Matt Oswalt
January 2023
Intermediate to advanced
458 pages
14h 16m
Chinese
Posts & Telecom Press
Content preview from 可编程网络自动化
自动化工具
299
9.2.5
 编写用于实现网络自动化的
Ansible
剧本
至此,我们了解了
Ansible
的架构,回顾了
Ansible
的清单文件以及剧本,还介绍了诸如剧
集、任务、模块、参数、变量等常用的
Ansible
术语
。本节将介绍更多的
Ansible
模块和特
定的
Ansible
功能
,同时会关注
Ansible
可能实现的功能,尤其是在网络自动化方面。我们
的重点是展示如何使用
Ansible
自动化下列任务。
创建多厂商配置模板,自动生成配置。
部署配置,确保指定配置存在。
从网络设备采集数据。
执行合规性检查。
生成报表。
1.
分解常见的核心网络模块
在完成上述任务和示例之前,需要先介绍一下
Ansible
针对大量网络厂商和操作系统所配
备的常用核心模块。了解这些至关重要,因为它们是
Ansible
自带的
核心
模块,而且工作
方式相似。下面是
3
种常见的核心网络模块。
command
用于向网络设备发送执行级命令。它的命名形式为
x
os_command
(比如
ios_command
nxos_command
junos_command
)。
config
用于向网络设备发送配置命令。它的命名形式为
x
os_config
(比如
ios_config
nxos_
config
junos_config
)。
facts
用于采集网络设备信息(比如操作系统版本、硬件平台、序列号、主机名、邻居等)。
它的命名形式为
x
os_facts
(比如
ios_facts
nxos_facts
junos_facts
等)
通过每种网络操作系统的这 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
Go程序设计语言

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu

Publisher Resources

ISBN: 9787115606181