ansible 批量部署准备工作

Ansible:自动化运维工具,基于Python开发

    功能{

      批量系统配置

      批量程序部署

      批量运行命令等等

}

准备工作:

一、操作主机安装epel源 和 ansible工具

yum -y install epel-release
yum -y install ansible
ansible --version

  

二、生成密钥对

ssh-keygen -t rsa  免密登录 一路回车即可

ssh-copy-id [email protected].(自己的ip)

ssh-copy-id [email protected].(自己的ip)需要批量部署的机器的ip

三、编辑ansible主机清单文件

vim /etc/hosts

[webservers]
192.168.189.139
192.168.189.128

四、测试是否可以与目标主机通信

ansible webservers -m ping

成功结果如下:

猜你喜欢

转载自www.cnblogs.com/security-guard/p/12027751.html