生产(库存文件):
#main ansible_host=54.293.2785.210 ansible_port=22 ansible_ssh_user=ubuntu
54.293.2785.210 ansible_ssh_user=ubuntu
运行临时命令:ansible all -i production -a "hostname"
有效!
但是当我取消注释第一行并注释第二行时:
ansible main -i production -a "hostname" -vvvv
给出以下错误:
main | FAILED => SSH Error: ssh: Could not resolve hostname main: Name or service not known
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
为什么这不起作用?