流浪的ansible供应商在运行剧本时抛出错误``MODULE FAILURE'' [英] Vagrant ansible provisioner throwing error 'MODULE FAILURE' when running playbook

查看:445
本文介绍了流浪的ansible供应商在运行剧本时抛出错误``MODULE FAILURE''的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过Ubuntu Xenial映像上的无业游民的ansible资源调配器运行剧本,但收到以下错误:

Trying to run a playbook through the ansible provisioner on vagrant on an Ubuntu Xenial image but receiving the following error:

播放[全部] ******************************************* **************************

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

任务[设置] *********************************************** ************************ 致命:[默认]:失败! => {已更改":false,失败":true,"module_stderr":与127.0.0.1的共享连接已关闭.\ r \ n","module_stdout":"\ r \ n/bin/sh:1:/usr/bin/python:找不到\ r \ n," msg:"模块失败} 要重试,请使用:--limit @/Users/user/Code/Vagrant/Ansible-Splunk-Ubuntu/test.retry

TASK [setup] ******************************************************************* fatal: [default]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "\r\n/bin/sh: 1: /usr/bin/python: not found\r\n", "msg": "MODULE FAILURE"} to retry, use: --limit @/Users/user/Code/Vagrant/Ansible-Splunk-Ubuntu/test.retry

PLAY RECAP ********************************************** ************************ 默认值:ok = 0更改= 0不可达= 0失败= 1

PLAY RECAP ********************************************************************* default : ok=0 changed=0 unreachable=0 failed=1

Ansible无法成功完成.任何错误输出应为 在上方可见.请更正这些错误,然后重试.

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

推荐答案

结果显示了Vagrant为我下载的Ubuntu映像没有Python(甚至没有Python3)!

Turns out the Ubuntu image that Vagrant downloaded for me did not have Python (not even Python3)!

Ansible需要python2才能正常运行.为了解决我的问题,我使用ssh进入了我的Ubuntu VM,并运行了安装了Python2.7的"sudo apt-get install" python.

Ansible requires python2 in order to function properly. To solve my issue, I ssh'd into my Ubuntu VM and ran 'sudo apt-get install' python which installed Python2.7.

然后,我再次从主机上调配了VM,并且我的剧本运行正常,没有任何问题.

Then I provisioned my VM again from my host machine -- and my playbook ran fine without any problems.

一个更好的解决方案是在您的vagrantfile中包含一行,以通过shell设置python2.

A better solution would be to probably include a line in your vagrantfile that provisions python2 via the shell.

这篇关于流浪的ansible供应商在运行剧本时抛出错误``MODULE FAILURE''的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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