Merge "Configure ansible forks based on cores"

This commit is contained in:
Zuul 2020-06-06 00:33:47 +00:00 committed by Gerrit Code Review
commit 8e1c589b2f
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import logging
from six.moves.configparser import ConfigParser
import json
import multiprocessing
import netaddr
import os
import os.path
@ -475,7 +476,7 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
'-T'
).format(os.devnull)
env['ANSIBLE_DISPLAY_FAILED_STDERR'] = True
env['ANSIBLE_FORKS'] = 36
env['ANSIBLE_FORKS'] = multiprocessing.cpu_count() * 4
env['ANSIBLE_TIMEOUT'] = ansible_timeout
env['ANSIBLE_GATHER_TIMEOUT'] = 45
env['ANSIBLE_SSH_RETRIES'] = 3