public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/2] ansible: Increase default task parallelism
@ 2025-04-17 17:21 cel
  2025-04-17 17:21 ` [PATCH 2/2] Makefile: Remove "-f 30" command line argument cel
  0 siblings, 1 reply; 3+ messages in thread
From: cel @ 2025-04-17 17:21 UTC (permalink / raw)
  To: kdevops; +Cc: Chuck Lever, Luis Chamberlain

From: Chuck Lever <chuck.lever@oracle.com>

Workflows with more than 5 target nodes were serializing on roles
that did not have "-f 30" specified explicitly.

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 3d9b635abb72..b587596bc8d5 100644
--- a/kconfigs/Kconfig.ansible_cfg
+++ b/kconfigs/Kconfig.ansible_cfg
@@ -6,6 +6,10 @@ config ANSIBLE_CFG_INTERPRETER_PYTHON_SET_BY_CLI
 	bool
 	default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_INTERPRETER_PYTHON)
 
+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"
@@ -172,6 +176,37 @@ config ANSIBLE_CFG_INTERPRETER_PYTHON_STRING
 
 endmenu
 
+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 f8ec327a5a16..e01de2f4481d 100644
--- a/playbooks/roles/ansible_cfg/defaults/main.yml
+++ b/playbooks/roles/ansible_cfg/defaults/main.yml
@@ -9,3 +9,4 @@ 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_interpreter_python: "auto_silent"
+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 666ee344901d..2bc916321f42 100644
--- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
+++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2
@@ -9,6 +9,7 @@ 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 }}
 interpreter_python = {{ ansible_cfg_interpreter_python_string }}
+forks = {{ ansible_cfg_forks }}
 {% if ansible_facts['distribution'] == 'openSUSE' %}
 [connection]
 retries = {{ ansible_cfg_reconnection_retries }}
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-18  3:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 17:21 [PATCH 1/2] ansible: Increase default task parallelism cel
2025-04-17 17:21 ` [PATCH 2/2] Makefile: Remove "-f 30" command line argument cel
2025-04-18  3:06   ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox