Thanks guys. A shell wait combined with async is probably the way to go. 
I'll test tomorrow and report back!

On Thursday, October 8, 2015 at 6:32:58 PM UTC+2, Vikas Kumar wrote:
>
> Hi Trond,
>
> I use these tasks to reboot servers. These work fine for CentOS 6 and 7 
> servers.
>
> - shell: sleep 5 && shutdown -r "{{ '1' if 
> ansible_distribution_major_version == '7' else 'now' }}"
> - local_action: wait_for host={{ ansible_hostname }} port=22 timeout=300 
> delay=90 state=started
>
> Hope this helps.
>
> Regards,
> Vikas
>
>
> On Friday, 9 October 2015 00:00:33 UTC+11, 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/ce33427f-658c-4f91-ae43-00885cb718ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to