ansible: Increase default task parallelism
PATCH v2 1/1 ansible: Increase default task parallelism
From: Chuck Lever <[email protected]>
Enable the workflows with more than 5 target nodes to run with full concurrency.
Reviewed-by Luis Chamberlain <[email protected]>
Signed-off-by Chuck Lever <[email protected]>
--- kconfigs/Kconfig.ansible_cfg | 35 +++++++++++++++++++ playbooks/roles/ansible_cfg/defaults/main.yml | 1 + .../ansible_cfg/templates/ansible.cfg.j2 | 1 + 3 files changed, 37 insertions(+)
kconfigs/Kconfig.ansible_cfg +35 -0
@@ -2,6 +2,10 @@ config ANSIBLE_CFG_CALLBACK_PLUGIN_SET_BY_CLI bool default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_CALLBACK_PLUGIN) +config ANSIBLE_CFG_FORKS_SET_BY_CLI + bool + default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_FORKS) + menu "Ansible Callback Plugin Configuration" choice prompt "Ansible Callback Plugin"
@@ -108,6 +112,37 @@ config ANSIBLE_CFG_DEPRECATION_WARNINGS Toggle to control the showing of deprecation warnings https://docs.ansible.com/ansible/latest/reference_appendices/config.html#deprecation-warnings +config ANSIBLE_CFG_FORKS_CUSTOM + bool "Enable a custom Ansible forks setting" + default n + help + When this setting is enabled, specify the maximum number + of concurrent Ansible tasks (forks) via Kconfig. When this + setting is disabled, kdevops chooses a default value that + can be overridden with "ANSIBLE_CFG_FORKS=NN" on the + "make" command line. + +if ANSIBLE_CFG_FORKS_CUSTOM + +config ANSIBLE_CFG_FORKS + int "forks" + output yaml + help + Set the maximum number of concurrent Ansible tasks (forks). + https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#setting-the-number-of-forks + +endif # ANSIBLE_CFG_FORKS_CUSTOM + +if !ANSIBLE_CFG_FORKS_CUSTOM + +config ANSIBLE_CFG_FORKS + int + output yaml + default 10 if !ANSIBLE_CFG_FORKS_SET_BY_CLI + default $(shell, ./scripts/append-makefile-vars-int.sh $(ANSIBLE_CFG_FORKS)) if ANSIBLE_CFG_FORKS_SET_BY_CLI + +endif # !ANSIBLE_CFG_FORKS_CUSTOM + if DISTRO_OPENSUSE config ANSIBLE_CFG_RECONNECTION_RETRIES
playbooks/roles/ansible_cfg/defaults/main.yml +1 -0
@@ -8,3 +8,4 @@ ansible_cfg_callback_plugin_display_skipped_hosts: true ansible_cfg_callback_plugin_show_custom_stats: false ansible_cfg_callback_plugin_show_per_host_start: true ansible_cfg_callback_plugin_show_task_path_on_failure: true +ansible_cfg_forks: 10
playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 +1 -0
@@ -8,6 +8,7 @@ display_skipped_hosts = {{ ansible_cfg_callback_plugin_display_skipped_hosts }} show_custom_stats = {{ ansible_cfg_callback_plugin_show_custom_stats }} show_per_host_start = {{ ansible_cfg_callback_plugin_show_per_host_start }} show_task_path_on_failure = {{ ansible_cfg_callback_plugin_show_task_path_on_failure }} +forks = {{ ansible_cfg_forks }} {% if ansible_facts['distribution'] == 'openSUSE' %} [connection] retries = {{ ansible_cfg_reconnection_retries }}
Signature · 1 line
2.49.0