Centos 7.2+Ubuntu 17.04安装ansible详解

二进制安装方式

Centos 7.2安装

一:PIP方式安装ansible
1.安装python-pip及python-devel程序包,yum -y install python-pip python-devel
2.安装开发环境gcc.glibc等,yum -y install gcc glibc-devel zlib-devel rpm-build openssl-devel
3.升级本地PIP到最新版本,pip install --upgrade pip
4.安装ansible服务,pip install ansible --upgrade
5.验证安装,ansible --version
二:YUM安装安装ansible
ansible被收录在epel源中,需要先安装epel源,如果之前安装过,也可以用第二条命令升级yum源
1.yum -y install epel-release
2.rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
3.安装ansibile,yum -y install ansible
4.验证安装,ansible --version

Ubuntu 17.04安装

一:apt-get方式安装
1.添加ansible源,apt-add-repository -y ppa:ansible/ansible(成功会有OK的提示)
2.升级库文件,apt-get update
3.安装ansibile,apt-get -y install ansible
4.验证安装,ansible --version

源码安装方式

Centos 7.2安装

1.安装git,yum -y install git
2.使用git拉取ansible软件包到当前目录,git clone git://github.com/ansible/ansible.git --recursive
3.切换至程序包目录,cd ./ansible
4.执行脚本安装ansible软件包,source ./hacking/env-setup(成功会有done提示)
Centos 7.2+Ubuntu 17.04安装ansible详解
5.验证安装,ansible --version

Ubuntu 17.04安装

安装方法同Centos大同小异,yum换成apt-get即可。

转载于:https://blog.51cto.com/12943999/2049660

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值