ansible/ansible — pull request #976 by tbielawa (2012-08-31 04:56:14+00:00)
Title: Pause tasks (incomplete)

This PR will add pause tasks in playbooks. Pause supports 'minutes', 'seconds', and 'prompt' parameters.

The implementation is done in a general way such that the model is easily extended to new non-action/local_action type tasks in the future.

The pause task is able to handle ^C interrupts without conflicting with the KeyboardInterrupt handler higher up in the Runner stack. I think though that the specific implementation needs a tweak. If you ^C during a pause and actually *need* to terminate the application you can't just press it once and expect it to quit, you'd have to hold it down. I think there needs to be a more obvious way to impart the correct quit technique, and it needs to be garanteed not to execute another task (like enabling something in a load balancer, for example) before the application fully quits.

First thoughts:

* User hits ^C
* User is prompted: "Quit? (y/n)"
* $needful

I hope you find changes to the CORE API code acceptable. I took extra special care to only make the minimal amount of necessary changes to accomplish this.

I know I have this marked as incomplete in the PR subject, but much to my great surprise I think it actually is functioning as-expected when serial > 1.

Not that these will be features in high demand, but things like only_if are probably not working.

There is an example I added that explain the common use cases. $ENTERPRISEY++;