获取“msg:无法找到所需的可执行文件easy_install"尝试使用 ansible 启动 vagrant 实例时 [英] Getting "msg: Failed to find required executable easy_install" when trying to bring up a vagrant instance with ansible

查看:26
本文介绍了获取“msg:无法找到所需的可执行文件easy_install"尝试使用 ansible 启动 vagrant 实例时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个人.一项使命.使用 Ansible 配置 Vagrant 机器以用作 Python 开发环境.

One man. One mission. Configure a Vagrant machine with Ansible for use as a Python development environment.

我尝试使用 Ansible 配置 Vagrant 机器.

I have attempted to provision a Vagrant machine with Ansible.

我根据此处概述的说明为其设置了目录结构:https://danielgroves.net/notebook/2014/05/development-environments/

I set up my directory structure for it according to the instructions outlined here: https://danielgroves.net/notebook/2014/05/development-environments/

一切都很顺利,如对vagrant up"的响应的初始部分所示:

Everything went swimmingly, as shown in the initial part of the response to "vagrant up":

$vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: wa2_default_1413954520562_41027
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Available bridged network interfaces:
1) wlan0
2) eth0
    default: What interface should the network bridge to? 1
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: bridged
==> default: Forwarding ports...
    default: 8080 => 8080 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /home/useruser/proj/wa2
==> default: Running provisioner: ansible...
ANSIBLE_FORCE_COLOR=true ANSIBLE_HOST_KEY_CHECKING=false PYTHONUNBUFFERED=1 ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s' ansible-playbook --private-key=/home/useruser/.vagrant.d/insecure_private_key --user=vagrant --connection=ssh --limit='default' --inventory-file=/home/useruser/proj/wa2/.vagrant/provisioners/ansible/inventory -vvv provision/playbook.yml

PLAY [all] ******************************************************************** 

GATHERING FACTS *************************************************************** 
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE setup
<127.0.0.1> EXEC ['ssh', '-C', '-tt', '-q', '-o', 'ForwardAgent=yes', '-o', 'ControlMaster=auto', '-o , 'ControlPersist=60s', '-o', 'ControlPath=/home/useruser/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=2222', '-o', 'IdentityFile="/home/useruser/.vagrant.d/insecure_private_key"', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '127.0.0.1', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052 && echo $HOME/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052'"]
<127.0.0.1> PUT /tmp/tmpr8f2Xo TO /home/vagrant/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052/setup
<127.0.0.1> EXEC ['ssh', '-C', '-tt', '-q', '-o', 'ForwardAgent=yes', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/home/useruser/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=2222', '-o', 'IdentityFile="/home/useruser/.vagrant.d/insecure_private_key"', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '127.0.0.1', u"/bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052/setup; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1413954587.93-167869388068052/ >/dev/null 2>&1'"]
ok: [default]

TASK: [easy_install name=pip] ************************************************* 
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE easy_install name=pip
<127.0.0.1> EXEC ['ssh', '-C', '-tt', '-q', '-o', 'ForwardAgent=yes', '-o', 'ControlMaster=auto', '-o , 'ControlPersist=60s', '-o', 'ControlPath=/home/useruser/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=2222', '-o', 'IdentityFile="/home/useruser/.vagrant.d/insecure_private_key"', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '127.0.0.1', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270 && echo $HOME/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270'"]
<127.0.0.1> PUT /tmp/tmptFp6Ev TO /home/vagrant/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270/easy_install
<127.0.0.1> EXEC ['ssh', '-C', '-tt', '-q', '-o', 'ForwardAgent=yes', '-o', 'ControlMaster=auto', '-o , 'ControlPersist=60s', '-o', 'ControlPath=/home/useruser/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=2222', '-o', 'IdentityFile="/home/useruser/.vagrant.d/insecure_private_key"', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'User=vagrant', '-o', 'ConnectTimeout=10', '127.0.0.1', u"/bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270/easy_install; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1413954593.04-227274886109270/ >/dev/null 2>&1'"]
failed: [default] => {"failed": true}
msg: Failed to find required executable easy_install

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
       to retry, use: --limit @/home/useruser/playbook.retry

default                    : ok=1    changed=0    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

我的目录树在这里:http://hastebin.com/qecudisuco.avrasm

最终,目标是在 Vagrant 中为 GAE 工作做好准备,并使用 Ansible 进行自动配置.(这可能是也可能不是一个好主意.)

Ultimately, the goal is to get set up for GAE work in Vagrant, with Ansible for automatic provisioning. (This may or may not be a good idea.)

failed: [default] => {"failed": true}
msg: Failed to find required executable easy_install

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/useruser/playbook.retry

default                    : ok=1    changed=0    unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

如何让 Ansible 在我的 Vagrant 机器上安装 pip?

How do I get Ansible to install pip on my Vagrant box?

真的任何 python 配置都可以工作.

Really any python provisioning will work.

我已经通读了文档或剧本以及easy_install.

I have read through the documentation or playbooks and easy_install.

对于那些担心缺少库存文件的人,Vagrant 自己创建了一个.Vagrantup.com 有一个关于此的页面,如果我获得了必要的声誉,我会发布该页面.

For those worried about the lack of an inventory file, Vagrant creates one on its own. Vagrantup.com has a page on this, which I will post if I get the reputation necessary for it.

我再仔细想想这个问题,然后再修改它.

I'll go back through this question and revise it after I have thought about this a bit more.

推荐答案

它正在尝试使用 easy_install name=pip 安装 pip.那已经过时了,easy_install 不应再使用.

It's trying to install pip by using easy_install name=pip. That's outdated, easy_install should no longer be used.

当前的方法是运行 get-pip.py(参见 安装说明).在 Ansible 中运行的命令是 python get-pip.py.

The current approach is to run get-pip.py (see installation instructions). The command to run in Ansible is then python get-pip.py.

这篇关于获取“msg:无法找到所需的可执行文件easy_install"尝试使用 ansible 启动 vagrant 实例时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆