一、测试环境说明
1、系统:rhel6.9
2、ip地址:20.20.20.24/24 20.20.20.41/24 20.20.20.42/24
3、以下操作使用root身份进行,也可以使用具有sudo权限的用户进行相关操作
二、环境准备
1、关闭iptables防火墙、selinux
# /etc/init.d/iptables stop
# chkconfig iptables off
# setenforce 0
# sed -i ‘/^SELINUX=/cSELINUX=disabled‘ /etc/selinux/config
三、安装
# yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
# yum install -y ansible
四、修改配置文件
# cd /etc/ansible/
# cp hosts{,.bak}
# cp ansible.cfg{,.bak}
# vim hosts
[rhel6.5]
20.20.20.41
20.20.20.42
# vim ansible.cfg
log_path = /var/log/ansible.log
accelerate_port = 5099
accelerate_multi_key = yes
五、双机互信
# ssh-keygen -t rsa
# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
# ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected]
CSDN原文:https://blog.csdn.net/qq_34889607/article/details/86574105
原文地址:http://blog.51cto.com/14037369/2345005