Browse Source

Configure ansible forks based on cores

At present we use a fixed value of 36. It seems the emperical
formula is 4 forks per core ans would be automatically limited
by ansible to the number of hosts.

Change-Id: I9a9e600935e3b8443341a1dc28421a19d9978bfe
(cherry picked from commit ce948ae049)
changes/14/734014/1
Rabi Mishra 1 month ago
parent
commit
19a26f32ae
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      tripleoclient/utils.py

+ 2
- 1
tripleoclient/utils.py 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
@@ -477,7 +478,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


Loading…
Cancel
Save