Re: [ansible-project] How to loop over result and retry in the same task?

2018-02-08 Thread Brian Coca
you CAN retry the first task, use until condition, i dont see a block
of tasks ...





-- 
--
Brian Coca

-- 
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/CACVha7faqPsi3Mvs7shJirV8nNQRvdhxmqf5Y7x2EWr1kGx%2BHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to loop over result and retry in the same task?

2018-02-08 Thread Eric Chong
But I want to retry the first task until expected result.  I don't see a 
way for Ansible to retry a bock of tasks.

On Tuesday, February 6, 2018 at 12:31:16 PM UTC-5, Brian Coca wrote:
>
> you cannot loop over the results of your task that is generating those 
> results, you CAN loop over the results of one task in a second task. 
>
>
>
>
>
> -- 
> -- 
> Brian Coca 
>

-- 
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/9701d9b4-3c86-4521-9baa-4fd6b078e17e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to loop over result and retry in the same task?

2018-02-06 Thread Brian Coca
you cannot loop over the results of your task that is generating those
results, you CAN loop over the results of one task in a second task.





-- 
--
Brian Coca

-- 
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/CACVha7dP%2B-Wa6wnNKEBZTTnPcNJS7Odj0MfVPPwOPNJ6%3DWmQsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to loop over result and retry in the same task?

2018-01-21 Thread Eric Chong
For example,  if I want a task to pull ec2_instance_facts until any 
instance is in running state, and retry if none is running.

---
- hosts: localhost
  gather_facts: no
  connection: local

  tasks:
  - name: get ec2_instance_facts
ec2_instance_facts:
register: my_ec2
until: item.state.name == 'running'
with_items: '{{ my_ec2.instances }}'

But I am getting error, because my_ec2 is not defined yet.

TASK [get ec2_instance_facts] 
**
fatal: [localhost]: FAILED! => {"failed": true, "msg": "'my_ec2' is 
undefined"}

Is it possible to loop over the result and retry the task in a single 
task?  If I have to make a second task to loop over the result, I can't go 
back to retry the first task.  How does Ansible handle retry of multiple 
tasks?

Thanks

-- 
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/fd013a66-ab84-467f-9d7e-d3819710cfd4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.