Commit 16d03204 by Benno Joy

Update playbooks2.rst

parent daf2f491
...@@ -461,11 +461,11 @@ from turning into arbitrary code with ugly nested ifs, conditionals, and so on - ...@@ -461,11 +461,11 @@ from turning into arbitrary code with ugly nested ifs, conditionals, and so on -
in more streamlined & auditable configuration rules -- especially because there are a in more streamlined & auditable configuration rules -- especially because there are a
minimum of decision points to track. minimum of decision points to track.
Do/Until Do-Until
```````` ````````
Sometimes you would want to retry a task till a certain condition is met, In such conditions the Do/Until feature will help. Sometimes you would want to retry a task till a certain condition is met, In such conditions the Do/Until feature will help.
Here's an example which show's the syntax to be applied for the task. Here's an example which show's the syntax to be applied for the task.::
- action: shell /usr/bin/foo - action: shell /usr/bin/foo
register: result register: result
...@@ -479,9 +479,12 @@ been retried for 5 times with a delay of 10 seconds. The default value for "retr ...@@ -479,9 +479,12 @@ been retried for 5 times with a delay of 10 seconds. The default value for "retr
The task returns the results returned by the last task run. The results of individual retries can be viewed by -vv option. The task returns the results returned by the last task run. The results of individual retries can be viewed by -vv option.
The results will have a new key "attempts" which will have the number of the retries for the task. The results will have a new key "attempts" which will have the number of the retries for the task.
.. note:: .. Note::
The Do/Until does not take decision on whether to fail or pass the play when the maximum retries are completed, the user can The Do/Until does not take decision on whether to fail or pass the play when the maximum retries are completed, the user can
can do that in the next task as follows: can do that in the next task as follows.
Example::
- action: shell /usr/bin/foo - action: shell /usr/bin/foo
register: result register: result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment