Ansible-easy_install模块是否已弃用?

时间:2019-05-12 13:22:15

标签: ubuntu ansible vagrant

我正在为Vagrant设置ubuntu/trusty64框(Ansible)。

执行以下剧本时:

---
- hosts: all
  tasks:
    - name: install pip
      easy_install:
        name: pip
        state: present

    - name: install gunicorn and flask
      pip: name={{ item }}
      with_items:
         - gunicorn
         - flask

我收到以下错误:

  

无法在路径中找到所需的可执行文件easy_install

在寻找解决方案时,我发现this stackoverflow thread表明使用easy_install已过时。

我在Ansible easy_install docs中没有发现任何提示。

任何帮助将不胜感激。



我的Vagrantfile:

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.network "forwarded_port", guest: 80, host: 8080
  config.vm.provision :ansible do |ansible|
    ansible.playbook = "playbook.yml"
  end
end

运行:

Ansible 2.7.10。

流浪汉2.0.2。


提及的错误的完整Stacktrace:

  

任务[安装点]

     
     致命:[默认]:失败! => {“已更改”:false,“ msg”:“找不到   所需的可执行文件easy_install在路径中:   / usr / local / sbin:/ usr / local / bin:/ usr / sbin:/ usr / bin:/ sbin:/ bin:/ usr / games:/ usr / local / games“}           要重试,请使用:--limit @ / home / workspaces / python_flask / playbook.retry

     

PLAY RECAP

     

1 个答案:

答案 0 :(得分:0)

只需将我的评论转换为答案。

easy_install根本没有安装在您的基本无业游民的盒子上或在配置的路径中找不到。尽管安装python软件包是一种过时的方法,但是the module still exists

如果您在基本的无业游民的盒子上安装easy_install(通过重建它或在将ansible作为apt任务进行置备时),错误将消失。

同时,如果您最近安装了一个装有python的盒子(似乎是这种情况),那么pip已经很可能出现了,您可以跳过第一个任务。

相关问题