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.
Start your free trial

You might also like

Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

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

Go程序设计语言

艾伦A. A.多诺万, 布莱恩W. 柯尼汉
弱监督学习实用指南

弱监督学习实用指南

Wee Hyong Tok, Amit Bahree, Senja Filipi
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham

Publisher Resources

ISBN: 9787115606181