ansible - 将 Ansible 1.9.4 更新到 Ansible 2.0

标签 ansible ansible-2.x

我已经卸载了 ansible 1.9.4 并安装了 sudo apt-get install ansible ,版本 2.0.2。
但是当我执行时:

ikerlan$ ansible --version
ansible 1.9.4

我已经使用 ansible ppa 卸载并重新安装,安装时我可以看到:
Preparing to unpack .../ansible_2.0.0.2-1ppa~trusty_all.deb ...
Unpacking ansible (2.0.0.2-1ppa~trusty) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Configurando ansible (2.0.0.2-1ppa~trusty) ...
Processing triggers for python-support (1.0.15) ...

但是如果我检查ansible版本:
ikerlan@ikerlan-docker:~$ ansible --version
    ansible 1.9.4
      configured module search path = None

如果我运行下一个:
ikerlan@ikerlan-docker:~$ sudo dpkg -l | grep ansible
ii  ansible                                               2.0.0.2-1ppa~trusty                                 all          A radically simple IT automation platform

有什么帮助吗?谢谢

最佳答案

这是升级它的正确方法。即使正确安装 ansible 也不会更改版本。我在这里找到的解决方案效果很好。
https://groups.google.com/forum/#!topic/ansible-project/eCtBp2aDtCQ

sudo -H pip install --upgrade ansible

只需运行此命令即可升级并修复我们使用 ansible --version 检查的版本

它将像现在一样升级到最新的 2.1

关于ansible - 将 Ansible 1.9.4 更新到 Ansible 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34903026/

相关文章:

azure - 在 Azure DevOps 管道中运行 ansible 脚本

ansible - 如何显示长期运行的 Ansible 任务的进度?

Ansible 模板将 'u' 添加到模板中的数组

amazon-web-services - Ansible **偶尔**失败,主机无法访问 - 无法通过 ssh 连接到主机

ssh - 将 SSH key 部署到服务器

Ansible:剧本在角色目录中的目录中调用角色

maven - 使用 ansible playbook 在 docker 容器内运行 mvn clean install

ansible - 使用 delegate_to 运行 adhoc wait_for

python - 如何从 Ansible list 文件中获取主机列表?

google-compute-engine - Google Compute Engine 的 Ansible 提供的 JSON 凭证文件在哪里?