Dynamically set the number of Ansible forks.
Because our usage of Ansible is CPU-bound, the recommended value is 10 x CPU_CORES. Conflicts: tripleo_common/actions/ansible.py tripleo_common/tests/actions/test_ansible.py Change-Id: If6d2b22e20c66e5ebdef952746c8aba7c2d54537 Signed-off-by: Luke Short <ekultails@gmail.com> (cherry picked from commit87d45ac42c
) (cherry picked from commit40b9c183cc
) (cherry picked from commitca863c590d
) (cherry picked from commit16d0418333
)
This commit is contained in:
parent
c4839a8b09
commit
c99015249d
|
@ -13,6 +13,7 @@
|
|||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
import shutil
|
||||
import six
|
||||
|
@ -44,7 +45,7 @@ def write_default_ansible_cfg(work_dir,
|
|||
config.set('defaults', 'callback_whitelist', callbacks_whitelist)
|
||||
# suppress tasks if all hosts skip, was previously full_skip callback
|
||||
config.set('defaults', 'display_skipped_hosts', 'no')
|
||||
config.set('defaults', 'forks', '25')
|
||||
config.set('defaults', 'forks', str(multiprocessing.cpu_count() * 10))
|
||||
config.set('defaults', 'timeout', '30')
|
||||
config.set('defaults', 'gather_timeout', '30')
|
||||
|
||||
|
|
Loading…
Reference in New Issue