From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>,
Luis Chamberlain <mcgrof@kernel.org>
Subject: [PATCH v2] ansible: Increase default task parallelism
Date: Wed, 9 Apr 2025 10:43:39 -0400 [thread overview]
Message-ID: <20250409144339.888605-1-cel@kernel.org> (raw)
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
reply other threads:[~2025-04-09 14:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20250409144339.888605-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.