summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook/base.py
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2019-08-28 18:47:39 -0500
committerGitHub <noreply@github.com>2019-08-28 18:47:39 -0500
commit51b33b79c0f2a3dea0ba30f6278ec4d538b5b623 (patch)
tree48f595307e555445cf90473d08d447c7dc5e45ca /lib/ansible/playbook/base.py
parent7d1a981b61eb996c64c406a92f73022d4d3a041b (diff)
downloadansible-51b33b79c0f2a3dea0ba30f6278ec4d538b5b623.tar.gz
T woerner max concurrent (#60702)
* play, block, task: New attribute forks With this it is possible to limit the number of concurrent task runs. forks can now be used in play, block and task. If forks is set in different levels in the chain, then the smallest value will be used for the task. The attribute has been added to the Base class as a list to easily provide all the values that have been set in the different levels of the chain. A warning has been added because of the conflict with run_once. forks will be ignored in this case. The forks limitation in StrategyBase._queue_task is not used for the free strategy. Signed-off-by: Thomas Woerner <twoerner@redhat.com> * Handle forks in free strategy The forks attribute for the free strategy is handled in run in the free StrategyModule. This is dony by counting the amount of tasks where the uuid is the same as the current task, that should be queued next. If this amount is bigger or equal to the forks attribute from the chain (task, block, play), then it will be skipped to the next host. Like it is also done with blocked_hosts. Signed-off-by: Thomas Woerner <twoerner@redhat.com> * Test cases for forks with linear and free strategy With ansible_python_interpreter defined in inventory file using ansible_playbook_python. Signed-off-by: Thomas Woerner <twoerner@redhat.com> * Changing forks keyword to throttle and adding some more docs
Diffstat (limited to 'lib/ansible/playbook/base.py')
-rw-r--r--lib/ansible/playbook/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ansible/playbook/base.py b/lib/ansible/playbook/base.py
index 78dbb74a2c..914425ff98 100644
--- a/lib/ansible/playbook/base.py
+++ b/lib/ansible/playbook/base.py
@@ -613,6 +613,7 @@ class Base(FieldAttributeBase):
_check_mode = FieldAttribute(isa='bool', default=context.cliargs_deferred_get('check'))
_diff = FieldAttribute(isa='bool', default=context.cliargs_deferred_get('diff'))
_any_errors_fatal = FieldAttribute(isa='bool', default=C.ANY_ERRORS_FATAL)
+ _throttle = FieldAttribute(isa='int', default=0)
# explicitly invoke a debugger on tasks
_debugger = FieldAttribute(isa='string')