ansible:安装篇

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包

centos

yum install python-devel

ubuntu

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编译器

centos

yum  install -y gcc 

ubuntu

apt install -y gcc 

 

然后再执行pip install ansible==2.0.0,就安装成功了。

 

博主:测试生财

座右铭:用测试完成原始积累,用投资奔向财务自由

csdn:https://blog.csdn.net/ccgshigao

博客园:https://www.cnblogs.com/qa-freeroad/

51cto:https://blog.51cto.com/14900374

你可能感兴趣的:(ansible:安装篇)