ansible是大名鼎鼎的自动化部署工具,结合docker和jenkins,可以快速搭建一套自动化部署方案,本文主要介绍如何快速安装ansible。
ansible安装前提:python2.7.x已安装
1. pip安装
centos
yum -y install epel-release
yum -y install python-pip
ubuntu
apt update
apt install python-pip
2. 查看pip版本
[root@localhost ~]# pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
pip已经安装成功
3. 安装ansible2.0.0版本
pip install ansible==2.0.0

安装报错: src/MD2.c:31:20: fatal error: Python.h: No such file or directory,这里缺少python开发包
4. 安装python-dev包
yum install python-devel
apt-get install python-dev
5. 继续安装ansible2.0.0
报如下错误
configure: error: in `/tmp/pip-install-I65EIU/pycrypto':
configure: error: no acceptable C compiler found in $PATH
需要系统安装gcc编译器
yum install -y gcc
apt install -y gcc
然后再执行pip install ansible==2.0.0,就安装成功了。
博主:测试生财(一个不为996而996的测开码农)
座右铭:专注测试开发与自动化运维,努力读书思考写作,为内卷的人生奠定财务自由。
内容范畴:技术提升,职场杂谈,事业发展,阅读写作,投资理财,健康人生。
csdn:https://blog.csdn.net/ccgshigao
博客园:https://www.cnblogs.com/qa-freeroad/
51cto:https://blog.51cto.com/14900374
微信公众号:测试生财(定期分享独家内容和资源)
![]()
ansible:安装篇