无法安装正确版本的 Ansible

问题描述 投票:0回答:2

我安装了

ansible==5.0
,但是要求在
2.10-2.11
之间。现在,每次我尝试删除它时,它都会显示
WARNING: Skipping ansible as it is not installed.
但是当我运行命令
ansible --version
时,输出显示 ansible 已安装版本
ansible [core 2.12.3]

我还尝试安装所需的版本,再次成功安装,但当版本命令再次运行时,它显示以前的版本。

(kolla-ansible-venv) root@ubuntu:/home/kypo/Desktop# sudo pip3 uninstall --yes ansible
WARNING: Skipping ansible as it is not installed.
(kolla-ansible-venv) root@ubuntu:/home/kypo/Desktop# apt remove ansible
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ansible' is not installed, so not removed
The following packages were automatically installed and are no longer required:
libfprint-2-tod1 libfwupdplugin1 libllvm10
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
(kolla-ansible-venv) root@ubuntu:/home/kypo/Desktop# ansible --version
ansible [core 2.12.3]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/kolla-ansible-venv/lib/python3.8/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /home/kolla-ansible-venv/bin/ansible
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
jinja version = 3.0.3
libyaml = True
(kolla-ansible-venv) root@ubuntu:/home/kypo/Desktop# sudo pip uninstall --yes ansible
WARNING: Skipping ansible as it is not installed.
(kolla-ansible-venv) root@ubuntu:/home/kypo/Desktop# 

我实际上想通过以下this链接安装openstack。

installation ansible version openstack
2个回答
0
投票

请从 ansible 服务器中删除添加的应用程序或创建新的虚拟机并在服务器中安装

git
python3
python3-pip
,然后克隆 Kolla-ansible 存储库并安装
requirement.txt
文件中的所有依赖项。 这是无需依赖即可安装 kolla-ansible 的最简单方法。


0
投票

回复似乎太晚了,但我写在这里是为了其他人。

由于它需要

2.10.0
2.11.0
之间的 ansible 版本,因此您应该安装此区间内的版本。正如您之前所说,您没有安装 Ansible,但应该检查其他 Ansible 软件包是否有。使用此命令:

pip list | grep ansible

然后选择列出的每个相关包(也许输出显示 kolla-ansible 或与您的问题无关的其他内容)并使用以下命令:

pip uninstall PACKAGES

在上面的命令中,您应该将 PACKAGES 替换为您已经找到的相关软件包(例如 ansible-base)。

然后使用此命令安装最适合您目的的 pip 软件包:

pip install 'ansible-core<2.11.0'

希望它对您下次尝试有所帮助。

© www.soinside.com 2019 - 2024. All rights reserved.