【发布时间】:2015-07-09 10:33:13
【问题描述】:
我正在尝试重新启动在 VirtualBox 上运行 CentOS 7 的服务器。我使用这个任务:
- name: Restart server
command: /sbin/reboot
async: 0
poll: 0
ignore_errors: true
服务器已重新启动,但出现此错误:
TASK: [common | Restart server] ***********************************************
fatal: [rolcabox] => SSH Error: Shared connection to 127.0.0.1 closed.
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
FATAL: all hosts have already failed -- aborting
我做错了什么?我该如何解决这个问题?
【问题讨论】:
-
根据 Marcin Skarbek 提供的答案,我准备并向 Ansible Galaxy 角色发布了使用该方法的内容。角色 Reboot-And-Wait 你可以找到here。感谢您的使用,欢迎反馈。
-
由于 Ansible 的快速发展,旧的答案不再适合我。请看我的回答。