From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>,
Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH 1/2] ansible: Increase default task parallelism
Date: Thu, 17 Apr 2025 13:21:18 -0400 [thread overview]
Message-ID: <20250417172119.3190398-1-cel@kernel.org> (raw)
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
next reply other threads:[~2025-04-17 17:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 17:21 cel [this message]
2025-04-17 17:21 ` [PATCH 2/2] Makefile: Remove "-f 30" command line argument cel
2025-04-18 3:06 ` Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250417172119.3190398-1-cel@kernel.org \
--to=cel@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=kdevops@lists.linux.dev \
--cc=mcgrof@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox