When you call 'shutdown -r now', that means the task cleanup is going to race against the system shutdown killing the ssh daemon. Even if you're running it async, you probably want a bit of delay.
Bill On Thu, Oct 8, 2015 at 9:02 AM, Trond Hindenes <[email protected]> wrote: > This is the actual error I'm getting: > fatal: [<servername>] => SSH Error: Shared connection > to <servername> closed. > > On Thursday, October 8, 2015 at 3:00:33 PM UTC+2, Trond Hindenes wrote: >> >> 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/3c9dcad6-e846-4f49-a2e4-596e392a86fe%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/3c9dcad6-e846-4f49-a2e4-596e392a86fe%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- Bill Nottingham Director of Product, Ansible ansible.com -- 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/CAEOkS_RZPYjWCkb9H-x4NrUiFj4P%3DKOtLXOdJA6LJjrQVhdO_A%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
