1、ansible是什么?
ansible是目前最受运维欢迎的自动化运维工具,基于Python开发,模块化工作,实现了批量系统配置、批量程序部署、批量运行命令等功能。
2、安装
yum -y install epel-release #安装epel-release包
yum -y install ansible #安装ansible
3、ansible目录结构
配置文件目录:/etc/ansible/
执行文件目录:/usr/bin/
Lib库依赖目录:/usr/lib/pythonX.X/site-packages/ansible/
4、ansible配置文件:/etc/ansible/ansible.cfg
/etc/ansible/hosts #主机清单,面保存的是一些 ansible 需要连接管理的主机列表。
1)添加主机组
[web] #定义主机组标签
192.168.45.45 #主机组包含的ip
2)组可以包含其他组
[web1] #组1
192.168.47.11
[web2]
192.168.47.12 #组2
[weball:children] #children不能变 weball里面包含了两个组
[web1]
[web2]
未完.....后续会更新
懒得更新了