1、安装依赖
yum -y install python-setuptools python2-cryptography python-jinja2 python-cryptography
2、centos Base yum源中没有ansible的安装包,需替换yum 源
cd /etc/yum.repos.d/ mv CentOS-Base.repo CentOS-Base.repo.bak wget -O epel.repohttp://mirrors.aliyun.com/repo/epel-6.repo yum -y clean all --verbose yum makecache yum install ansible #测试 ansible -m ping 192.168.1.104 -k