Hi, are you using wait_for?

- name: Reboot
  command: shutdown -r now

- name: Wait until ssh is available again
  local_action: wait_for port=22 host={{ inventory_hostname }}
search_regex=OpenSSH delay=10



David Karban
Linux server specialist/Specialista na správu linuxových serverů
www.karban.eu

2015-10-08 15:00 GMT+02:00 Trond Hindenes <[email protected]>:

> Hi all,
> As part of a playbook I reboot nodes if they're missing a file I'm
> checking against. This is done like so:
>
> - name: Reboot node if check file does not exist (we assume this is the
> first run)
>   command: shutdown -r now "Ansible updates triggered"
>   when: reboot_check_file.stat.exists == False
>   async: 0
>   poll: 0
>   ignore_errors: true
>
> However, whatever I do I always get a "exception: SSH Error: Shared
> connection to app10002 closed". How can I force ansible to continue running
> although it lost its connection?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/febef30b-6352-40d6-9143-cb0171036822%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/febef30b-6352-40d6-9143-cb0171036822%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAOBFM97kUBR%3D5X%2B7VS6cy%2BXZW0hRGNWejj90LEw%3DuVBgEAMA5g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to