如何安装较旧的ansible包?

Den*_*boy 5 rpm yum ansible

我需要安装ansible 2.1.0.0-1.el7.我的安装程序不适用于我安装的最新版本的ansible:

yum -y --enablerepo=epel install ansible
Run Code Online (Sandbox Code Playgroud)

这给了我ansible-2.2.0.0-3.el7.noarch.所以我试着列出旧版本,但我找不到它们:

# yum -y --enablerepo=epel --showduplicates list ansible
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror2.hs-esslingen.de
 * epel: epel.mirrors.ovh.net
 * extras: it.centos.contactlab.it
 * updates: mirror.netcologne.de
Available Packages
ansible.noarch                    2.2.0.0-3.el7                                epel
Run Code Online (Sandbox Code Playgroud)

这是我发现多个版本的网站,但我不知道如何安装它.

有人可以帮我安装我需要的Ansible版本吗?

Bru*_*lho 12

你应该用python pip安装它.

sudo yum install python-pip python-devel python
Run Code Online (Sandbox Code Playgroud)

然后:

sudo pip install pip --upgrade
sudo pip install ansible==2.1.0.0
Run Code Online (Sandbox Code Playgroud)

现在你应该可以使用:

ansible-playbook ...
Run Code Online (Sandbox Code Playgroud)

如果你没有设法用我给你的命令安装pip,请看一下:https://packaging.python.org/install_requirements_linux/