Ansible的安装非常简单,由以下几种方法。
(1)使用pip安装。
pip是Python的包管理工具,使用起来非常方便,只要操作系统安装由pip,直接pip install包名集客。安装Ansible的方法如下:
pip install ansible
(2)使用apt-get安装
在基于Debian/Ubuntu Linux的系统中使用apt-get安装Ansible。
sudo apt-get install softwaer-properties-common
sudo apt-add-respository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
(3) 使用yum安装
在基于RHEL/CentOS Linux的系统中使用yum安装ansible。
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install ansible
(4) 使用源代码安装
可以从Github上安装最新版本
cd ~
git clone git://github.com/ansible/ansible.git
cd ./ansible
source ./hacking/env-setup