ansible api 通过python 方式调用

pip3 install ansible Linux下面安装 Windows 安装没成功

 

from ansible.parsing.dataloader import DataLoader #读取yaml json格式文件

from ansible.vars.manager import VariableManager #用于存储各类总类变量信息

from ansible.inventory.manager import InventoryManager #用于导入inventory清单文件

from ansible.playbook.play import Play #存储执行hosts的角色信息

from ansible.executor.task_queue_manager import TaskQueueManager #ansible底层用到任务队列

from ansible.plugins.callback import CallbackBase #状态回调,各种成功失败的信息

from ansible.executor.playbook_executor import PlaybookExecutor #核心类执行playbook剧本

from ansible.inventory.host import Host,Group #操作单个主机和主机组的信息

相关文章

Python中的函数(二) 在上一篇文章中提到了Python中函数的定...
Python中的字符串 可能大多数人在学习C语言的时候,最先接触...
Python 面向对象编程(一) 虽然Python是解释性语言,但是它...
Python面向对象编程(二) 在前面一篇文章中谈到了类的基本定...
Python中的函数(一) 接触过C语言的朋友对函数这个词肯定非...
在windows下如何快速搭建web.py开发框架 用Python进行web开发...