Ansible 1.9.4 playbook randomly stops running after async

Hey. I’ve got this in my playbook:

  • name: Fire async to watch build
    shell: “CONTAINER=my_{{ timestamp }} /app/deploy/watch-docker.sh”
    async: 1200
    poll: 15
    register: watch_docker
    ignore_errors: true

  • name: Wait until built
    async_status:
    jid: “{{ watch_docker.ansible_job_id }}”
    register: job_result
    until: job_result.finished
    retries: 100
    delay: 15
    ignore_errors: true

and for some reason, after it passes the last action and goes onto the next ones, the script randomly stops working. No errors or anything, but the process just ends. It dies at different places, too, randomly on each host. The async poll usually takes about 7 minutes to run. I tried increasing the timeout on ansible.cfg to 30, but that did nothing either.

For reference, here’s the watch_docker.sh that gets called:

#!/bin/bash
if [ ! -z $CONTAINER ]; then
while true; do
docker exec $CONTAINER pgrep php5-fpm
catch=$?
if [ $catch -eq 0 ]; then
break
fi
sleep 5
done
fi
exit 0

I’m really at a loss as to what’s going on. Any ideas? Thanks!