Ansible vmware_guest 无法通过 ssh 进入 vmware vSphere vCenter [英] Ansible vmware_guest cannot ssh into vmware vSphere vCenter
问题描述
我正在尝试使用 ansible 设置虚拟机.但是,ansible 一直卡在 Deploy guest from template 任务上.
I'm trying to setup a virtual machine with ansible. However, ansible keeps getting stuck on the Deploy guest from template task.
使用 -vvv,我得到以下日志.
Using -vvv, I got the following logs.
尝试通过 ssh pubkey auth 登录时:
When attempting to log in via ssh pubkey auth:
TASK [Deploy guest from template]
<小时>
task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:12
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC ssh -C -o ControlMaster=auto
-o ControlPersist=60s -o KbdInteractiveAuthentication=no
-o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey
-o PasswordAuthentication=no -o User=root -o ConnectTimeout=10
-o ControlPath=/home/wilb/.ansible/cp/982c3c15ab
vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
当我尝试使用 --ask-pass 时,它卡在这里:
When I try to use --ask-pass, it gets stuck here:
TASK [Deploy guest from template] *******************************************************************************************************
task path: /home/wilb/Development/vcenter_demo/vcenter_demo.yml:14
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_guest.py
<vcenter.mycompany.com> ESTABLISH SSH CONNECTION FOR USER: root
<vcenter.mycompany.com> SSH: EXEC sshpass -d12 ssh -C
-o ControlMaster=auto -o ControlPersist=60s -o User=root
-o ConnectTimeout=10
-o ControlPath=/home/wilb/.ansible/cp/982c3c15ab
vcenter.mycompany.com '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
我可以手动登录到 vCenter.但是,要访问 shell,我首先必须在 vCenter 中键入:shell";默认情况下,它是一些奇怪的自定义提示.
I can login to the vCenter manually. However, to access the shell, I first have to type: "shell" in the vCenter; by default it's some weird customized prompt.
如何才能正确登录 vCenter 以自动部署 VM?
How can I get ansible to log into vcenter properly to automatically deploy a VM?
系统
- 控制器操作系统:Fedora 26
- Ansible:2.4.1
- vCenter:6.5.0.1000
推荐答案
Ansible vmware_guest 无法通过 ssh 进入 vmware vSphere vCenter
Ansible vmware_guest cannot ssh into vmware vSphere vCenter
不应该.
您应该从本地机器调用大部分云"模块.
看一下 vmware_guest 的示例:有 delegate_to: localhost
无处不在.
You should call most of "cloud" modules from local machine.
Take a look at examples of vmware_guest: there's delegate_to: localhost
everywhere.
这篇关于Ansible vmware_guest 无法通过 ssh 进入 vmware vSphere vCenter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!