Ansible surviving restarting of networking service

Hi,

I’ve completed a template for interface bonding on some of my metal (Ubuntu Server 13.04), see here:

https://gist.github.com/analytically/5760207

The next step is to restart networking to let the bond take over. But I’m having a hard time figuring out how Ansible can survive this.

  • name: wait for server to reboot and ssh to start again
    wait_for: delay=20 host=${inventory_hostname} port=22
    delegate_to: localhost

Tried delegate_to with wait_for, but still fails with the following error:

invalid output was: [sudo via ansible, key=scyvsualqzfanxxykrcmoejnoliqijdk] password:

Anyone any idea?

Thanks!

Mathias

I would restart it using async mode and do not request polling, this will engage “fire and forget” of the command, and then you can do the wait_for.