From d733f5af064aa24b710a57c96a41c53698dead8b Mon Sep 17 00:00:00 2001 From: Giovanni Sciortino Date: Wed, 30 Aug 2017 20:17:20 +0200 Subject: [PATCH] Add note in documentation and add warning related to retries parameter used without until (#28078) --- docs/docsite/rst/playbooks_loops.rst | 2 ++ lib/ansible/executor/task_executor.py | 1 + 2 files changed, 3 insertions(+) diff --git a/docs/docsite/rst/playbooks_loops.rst b/docs/docsite/rst/playbooks_loops.rst index 82d0732fd0..0d7d56c0ea 100644 --- a/docs/docsite/rst/playbooks_loops.rst +++ b/docs/docsite/rst/playbooks_loops.rst @@ -449,6 +449,8 @@ 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 registered variable will also have a new key "attempts" which will have the number of the retries for the task. +.. note:: If "until" parameter isn't defined, the value for "retries" is forced to 1. + .. _with_first_found: Finding First Matched Files diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 9d739dc928..58bd615dda 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -509,6 +509,7 @@ class TaskExecutor: retries += 1 else: retries = 1 + display.warning("The parameter 'retries' hasn't been defined, the value for 'retries' is forced to 1.") delay = self._task.delay if delay < 0: