前言
Ansible命令行执行方式有Ad-Hoc、playbook、web化(道听途说,据说要钱)、API开发;常用的几乎就是前面两种,也是官方推荐的。第一种属于临时命令,第二种属于文件执行方式。这章中介绍关于ansible的相关命令及功能(并非是Ad-hoc,Ad-hoc的命令也包含在其中)。
PS:Ansible是通过SSH协议来进行通信,我这里不做关于SSH秘钥验证的教程,详情请参考如下地址:
- https://www.cnblogs.com/guge-94/p/12018183.html
- https://www.cnblogs.com/guge-94/p/12017714.html
- https://www.cnblogs.com/guge-94/p/12017578.html
命令介绍
- ansible:Ad-Hoc临时命令,执行一些命令
- ansible-galaxy:通过下载量和关注量等信息来安装优秀的Roles
- ansible-pull:从被管理机器中拉取数据或者信息
- ansible-doc:Ansible各模块说明文档
- ansible-playbook:读取指定文件进行执行
- ansible-vault:用于文件加密
- ansible-console:为用户提供交互式工具