尝试使用ansible启动无业游民的实例时,获取“ msg:无法找到所需的可执行文件easy_install”

 丢失时 发布于 2022-12-15 23:50

一个人。一个任务。使用Ansible配置Vagrant机器,以用作Python开发环境。

我试图用Ansible设置Vagrant机器。

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

一切如鱼得水,如对“无所事事”的回应的第一部分所示:

$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

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

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盒子上安装点子?

实际上,任何python配置都可以使用。

我已经阅读了文档或剧本和easy_install。

对于那些担心缺少清单文件的人,Vagrant可以自己创建一个文件。Vagrantup.com上有一个页面,如果我获得此页面所必需的声誉,将在该页面上发布。

我会再考虑这个问题,然后再进行修改。

1 个回答
  • 它正在尝试使用来安装pip easy_install name=pip。那已经过时了,easy_install应该不再使用了。

    当前方法是运行get-pip.py(请参阅安装说明)。然后在Ansible中运行该命令python get-pip.py

    2022-12-16 00:21 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有