大佬教程收集整理的这篇文章主要介绍了使用Ansible for Windows VM的Vagrant,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用以下playbook.yml
--- - hosts: all tasks: - name: run win ping win_ping:
当我将ansible代码添加到我的Vagrantfile时,我收到以下错误
GATHERING FACTS *************************************************************** Failed: [default] => {"Failed": true,"parsed": falsE} /bin/sh: /usr/bin/python: No such file or directory
对我来说,这个错误意味着它无法找到Python,因为它正在寻找Python,就像它是一台Linux机器一样.
另外,我跑了
ansible windows -m win_ping
其中windows是Vagrant提出的VM的IP地址所以我怀疑问题不在于Ansible,而在于Vagrant如何调用Ansible.
有人试过VaGRANT ANsible用于Windows VM吗?是否有一些我不知道的东西(也许是传递给Ansible的选项)?
我使用Vagrant版本1.7.2和Ansible版本1.8.3
拥有由Vagrant管理的Windows框,您的配置文件group_vars / windows-dev应包含以下内容:
ansible_user: IEUser ansible_password: Passw0rd! ansible_port: 55986 # not 5986,as we would use for non-virtualized environments ansible_connection: winrm ansible_winrm_server_cert_validation: ignore
确保插入正确的凭据并为ansible-port选择正确的端口.使用Vagrant,您可以在流浪汉之后从Vagrant生成的日志消息中获取正确的端口.在我的情况下,这看起来像这样:
==> default: ForWARDing ports... default: 5985 (guest) => 55985 (host) (adapter 1) default: 5986 (guest) => 55986 (host) (adapter 1)
我的Vagrantfile could be found here,如果您有兴趣.它使用来自https://developer.microsoft.com/en-us/microsoft-edge/tools/vms的Windows 10 Stable(14.xxX)映像上的Microsoft Edge.
现在win_ping模块应该工作 – 假设您已经在Windows框中完成了所有必要的准备步骤,这些步骤以执行脚本ConfigureRemotingForAnsible.ps1为中心(更多信息可以在this blog post的Making Windows Ansible ready章节中找到):
ansible windows-dev -i hostsfile -m win_ping
以上是大佬教程为你收集整理的使用Ansible for Windows VM的Vagrant全部内容,希望文章能够帮你解决使用Ansible for Windows VM的Vagrant所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。