Thanks Giovanni

On Wed, Feb 4, 2015 at 12:54 PM, Giovanni Tirloni <[email protected]> wrote:

> On Tue, 03 Feb 2015 23:25 -0800, Tzach Livyatan
> <[email protected]> wrote:
> > Hello again
> > I have a command to execute X times, pausing for a few second after each
> > iteration.
> > One (working) way to do it is:
> >     - shell: sleep 60; the-command
> >       with_sequence: count={{X}}
> >
> >  But its look ugly to me:
> > - does not use built-in pause command
> > - make each of the host iterate independently, which may cause sync issue
> >
> > I would like to do something like (not legal)
> >     - shell: the-command
> >       action: pause: seconds=60
> >       with_sequence: count={{X}}
> > Using include for the two tasks didnt work either as include and
> > with_items
> > is deprecated.
> >
> > What is the right solution in this case?
>
> I think your initial solution is the cleanest way to do this right now.
>
> I was thinking if the shell module could be enhanced to accept a pause
> parameter, but I don't know how Ansible "unroll" the list of activities
> that should be carried out when there is looping involved. The module
> might not even know it's going to run multiple times (so then it
> couldn't pause anything, because it'd think it's running just once).
>
> If that's the case, then perhaps the looping construct(s) would have to
> accept a pause parameter.
>
> Perhaps something like the concept of "blocks" [1] being worked on in v2
> might help your situation. Create a block with a shell and a pause task
> and iterate over them.
>
Yes, block is what I was looking for.
Glad to see it will be available in v2.

I guess Greenspun's tenth rule apply to configuration mgmt SDL as well :)



>
> [1] -
> https://groups.google.com/d/msg/ansible-project/4IXdJqzhuM8/aGIJglZ8G_4J
>
> Giovanni
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/c3KOpaoMnhQ/unsubscribe.
> To unsubscribe from this group and all its topics, 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/1423047263.4066176.222930137.04FE27E8%40webmail.messagingengine.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards
@TzachL

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

Reply via email to