On Fri, Dec 19, 2014 at 2:30 PM, Xavier Krantz <xak...@gmail.com> wrote:
> Hello,
>
>
> I am trying to use the Async capabilities of ansible to "fire and forget" a
> job and then check it later and wait till its end.
> I have followed the example mentioned here :
> http://docs.ansible.com/playbooks_async.html

Async "fire and forget" was a new feature in Ansible 1.8 so you'll
need to update to get that functionality.

-AdamM

>
> But I am facing an issue and I don't really understand what's happening.
>
>
> The playbook looks like
>
>   - name: 'MyPlay | Fire and Forget'
>     command: "/opt/PROGRAM/bin/gremlin -e
> /opt/PROGRAM/scripts/load_graph.grm ..."
>     async: 1000
>     poll: 0
>     register: load_graph_async
>
>
>   - name: 'MyPlay | Check Job'
>     async_status: jid={{ load_graph_async.ansible_job_id }}
>     register: job_result
>     until: job_result.finished
>     retries: 30
>
>
>
> The playbook logs look like :
>
> TASK: [MyPlay | Fire and forget] *************************
> <job 759951815367.27671> finished on Host1
>
>
> TASK: [MyPlay | Check Job] *************************************
> fatal: [Host1] => error while evaluating conditional: job_result.finished
>
>
>
> What I do understand is :
>  job 759951815367.27671
>
> * 759951815367 is the JobID
> * 27671 is the PID of the wrapper process
>
>
> But when I go on the Host after the failed run, I saw
>
> root     27674  0.0  0.0 136548  3672 ?        S    21:15   0:00
> /usr/bin/python
> /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/async_wrapper
> 759951815367 1000 /home/USER/.ansibl
> root     27675  0.0  0.0 136548  3900 ?        S    21:15   0:00  \_
> /usr/bin/python
> /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/async_wrapper
> 759951815367 1000 /home/USER/.an
> root     27676  0.1  0.0 138008  7320 ?        S    21:15   0:00      \_
> /usr/bin/python
> /home/USER/.ansible/tmp/ansible-tmp-1419020105.57-13577669747697/command
> /home/USER/.ansible/tmp/ansible-tm
> root     27677  0.0  0.0 115504  1544 ?        S    21:15   0:00          \_
> /bin/bash /opt/PROGRAM/bin/gremlin -e /opt/PROGRAM/scripts/load_graph.grm
> ...
> root     27727 84.0 14.4 4875920 1187256 ?     Sl   21:15   0:21
> \_ /usr/lib/jvm/java-7-oracle/bin/java -server -Xms4g -Xmx4g -cp
> /opt/PROGRAM/conf:/opt/PROGRAM
>
>
> So any ideas ?
>
>
> Thanks a lot for your help every one :)
>
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/4c29214f-ce7d-4c30-8bdd-4107736a92eb%40googlegroups.com.
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAA_4i2EGV9fBrwCS3HeN8eoQ_7Axe7Cj-ZTYcnFhkjX-RPJcKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to