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 可编程网络自动化
自动化工具
287
(也就是安装了
Ansible
的机器),通过
SSH
连接到每台被自动化的服务器。控制主机随后
会将
Python
代码复制到各台服务器—
—这些代码负责执行自动化任务,包括从重启
Linux
进程、安装
Linux
软件包到更新文本文件
、从
Git
仓库中拉取更新,或者仅仅是在被自动
化的目标
Linux
机上运行
bash
脚本。如果有
100
Linux
服务器被自动化,那么就有
100
台服务器会运行
Ansible
“代码”
(或模块)来执行任务。
Ansible
也可用于自动化
Windows
服务器,但这里描述的是
Ansible
的起源和
最常见的用法,以及与自动化网络设备相比的情况。
2.
自动化网络设备
Ansible
自动化网络设备的工作方式略有不同
。在这种情况下,
Ansible
采用的是本地(或
集中化)形式。当自动化网络设备时,
Ansible
控制主机会被配置为以
本地
模式运行。在
这种模式下,
Ansible
不会通过
SSH
连接到每个设备
,也不会将
Python
代码复制到各个网
络设备。实际上,在本地模式下运行时,
Ansible
会连接到自身并在
本地
执行
Python
码。
在本地执行的
Python
代码仍然可能通过
SSH
连接网络设备
,不过也可能通过
API
(或
Telnet
SNMP
)连接
。但即便
Ansible
经由
SSH
连接到网络设备,
Python
文件也不会被
复制到设备,
CLI
命令只是在
SSH
连接上发送
。从高层角度来看,这就类似于在服务器上
执行
Python
脚本,同时自动化一些网络设备。
网络模块也可以不在本地模式下运行,但这需要对许多网络操作系统进行更 ...
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