* [PATCH v2] ansible: Increase default task parallelism
@ 2025-04-09 14:43 cel
0 siblings, 0 replies; only message in thread
From: cel @ 2025-04-09 14:43 UTC (permalink / raw)
To: kdevops; +Cc: Chuck Lever, Luis Chamberlain
From: Chuck Lever <chuck.lever@oracle.com>
Enable the workflows with more than 5 target nodes to run
with full concurrency.
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
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(+)
diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg
index 7286b0fe5025..d81a574ba239 100644
--- a/kconfigs/Kconfig.ansible_cfg
+++ b/kconfigs/Kconfig.ansible_cfg
@@ -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
diff --git a/playbooks/roles/ansible_cfg/defaults/main.yml b/playbooks/roles/ansible_cfg/defaults/main.yml
index c98334aa8f81..42a9e58f0658 100644
--- a/playbooks/roles/ansible_cfg/defaults/main.yml
+++ b/playbooks/roles/ansible_cfg/defaults/main.yml
@@ -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
diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
index e13931b5ce97..04ae67782c20 100644
--- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
+++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
@@ -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 }}
--
2.49.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-04-09 14:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09 14:43 [PATCH v2] ansible: Increase default task parallelism cel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox