码迷,mamicode.com
首页 > 其他好文 > 详细

ansible安装

时间:2016-08-08 12:12:50      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:

配置epel源

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

安装ansible

yum install -y ansible

验证安装

ansible --version

配置SSH连接

ssh-keygen -t rsa
ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.10.120
ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.10.121
ssh-copy-id -i /root/.ssh/id_rsa.pub root@192.168.10.122

IP根据自己的情况去修改
注:如果报以下错误时,安装依赖包即可

错误: -bash: ssh-copy-id: command not found
解决: yum -y install openssh-clients

安装ansible 2.0

先安装pip

wget https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#md5=3a73c4188f8dbad6a1e6f6d44d117eeb
tar -zxvf pip-8.0.2.tar.gz -C /usr/local
cd /usr/local/pip-8.0.2
python setup.py install
yum install gcc python-devel

然后安装ansible

pip install ansible

pip install PyCrypto==2.3

ansible安装

标签:

原文地址:http://www.cnblogs.com/galengao/p/5748446.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!