# Ansible surviving restarting of networking service

**URL:** <https://forum.ansible.com/t/ansible-surviving-restarting-of-networking-service/12946>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 11, 2013, 8:16pm UTC](https://forum.ansible.com/t/ansible-surviving-restarting-of-networking-service/12946 "2013-06-11T20:16:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Bogaert](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@Mathias\_Bogaert](https://forum.ansible.com/u/Mathias_Bogaert)\
**Post date:** [June 11, 2013, 8:16pm UTC](https://forum.ansible.com/t/ansible-surviving-restarting-of-networking-service/12946/1 "2013-06-11T20:16:48Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [June 12, 2013, 10:47am UTC](https://forum.ansible.com/t/ansible-surviving-restarting-of-networking-service/12946/2 "2013-06-12T10:47:36Z")

</div>

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.
