From 576962d335ac49c0f5d9792bcbddfde0d065081a Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 23 Jul 2013 20:43:14 -0400 Subject: [PATCH] now if you set fork to 0 or a number higher than the number of hosts, it will be readjusted to the number of hosts runner is going to deal with. Signed-off-by: Brian Coca --- lib/ansible/runner/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index d90763734f..46e0e3e236 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -886,6 +886,9 @@ class Runner(object): # host. p = utils.plugins.action_loader.get(self.module_name, self) + if self.forks == 0 or self.forks > len(hosts): + self.forks = len(hosts) + if p and getattr(p, 'BYPASS_HOST_LOOP', None): # Expose the current hostgroup to the bypassing plugins