相关疑难解决方法(0)

如何使用Ansible等待服务器重启?

我正在尝试重新启动服务器,然后等待,使用此:

- name: Restart server
  shell: reboot

- name: Wait for server to restart
  wait_for:
    port=22
    delay=1
    timeout=300
Run Code Online (Sandbox Code Playgroud)

但我得到这个错误:

TASK: [iptables | Wait for server to restart] ********************************* 
fatal: [example.com] => failed to transfer file to /root/.ansible/tmp/ansible-tmp-1401138291.69-222045017562709/wait_for:
sftp> put /tmp/tmpApPR8k /root/.ansible/tmp/ansible-tmp-1401138291.69-222045017562709/wait_for

Connected to example.com.
Connection closed
Run Code Online (Sandbox Code Playgroud)

linux deployment ssh ansible ansible-playbook

42
推荐指数
6
解决办法
6万
查看次数

标签 统计

ansible ×1

ansible-playbook ×1

deployment ×1

linux ×1

ssh ×1