centos7最小化安装ansibles

1、error: cffi 1.6.0 is installed but cffi>=1.7 is required by set(['cryptography'])


yum remove -y python-cffi
pip install cffi>=1.8.0


2、easy_install command not found


wget https://bootstrap.pypa.io/ez_setup.py -O - | python


安装ansible 

#easy_install simplejson

#easy_install pip

#yum install gcc python-devel

#easy_install ansible


ansible验证安装


设置无密码ssh访问远程主机:

1
2
#ssh-keygen -t rsa
#ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.10.24

创建ansible主机列表:

默认路径 /etc/ansible/hosts  主机列表可以是静态配置文件,可通过 -i 选项指定。


1
2
3
4
#mkdir /etc/ansibles
# vi /etc/ansible/hosts
[ test ]
192.168.10.24

测试远程主机的运行状态

1
2
3
4
5
# ansible test -m ping
192.168.10.24 | SUCCESS => {
     "changed" false
     "ping" "pong"
}


本文转自 jackjiaxiong 51CTO博客,原文链接:http://blog.51cto.com/xiangcun168/1959217



Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐