一、Ansible权威指南
1、官网
2、Ansible中文权威指南
http://ansible-tran.readthedocs.io/en/latest/
3、Ansible自动化运维教程
https://www.w3cschool.cn/automate_with_ansible/
Ansible最直接的作用是批量系统配置、批量程序部署、批量运行命令等功能
最简便的就是不用在客户机安装软件!
二、实验环境
系统版本 IP Python环境 主机名 角色
RHEL7 172.25.5.1 Python3.6 lxn1 anslble部署机
CentOS 172.25.5.2 lxn2 客户机
RHEL7 172.25.5.3 lxn3 客户机
三、安装Ansible
# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# yum install ansible -y
如果无法安装,出现如下报错,请安装Python3.6
点我查看如何安装Python3.6
四、体验第一条ansible命令
编辑/etc/ansible/hosts 并在其中加入一个或多个远程系统
# vim /etc/ansible/hosts