diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index afdd99a1d90..7a5290f3c7a 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -892,6 +892,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