From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A1F285040 for ; Thu, 2 Oct 2025 20:21:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759436503; cv=none; b=V1YcPLIoggcZzXovhl5DHtdv7pSEtOnEHWlgo5qvpds4D+mCcwGwvbbi8syoCzgY0VO++3kC3L98ZBFipUo4xHKWoqyiMf8bTARlw0kwx03NqXJeGzRWOScydx+N0lpTMB32UvhhU1EXpofXO++npyD5u7UQkeRbXtYpuVCT38I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759436503; c=relaxed/simple; bh=oKa1bzbAs+LO1PcJ/IV0Lyr+KamJJnxHuuC+mahrJ80=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VKG73qdWUmNd28uoYPjX7vGDm7PdWMCD70hqiiVS1XDLELOCrdwjaB3YmH64R2ySid6l+RhzZMStPAFc5clk14OWk+aakRV0/XhhRQ4rPmI8dIDEIt/KLejU/bLoOgJ4hpI5gqfDrK1MqQYdZOby7EwWZa6vKu3gb3UEASleybg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KcahhI/Q; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KcahhI/Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5425C4CEFA; Thu, 2 Oct 2025 20:21:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759436502; bh=oKa1bzbAs+LO1PcJ/IV0Lyr+KamJJnxHuuC+mahrJ80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KcahhI/Q5rN6IT+bUfrDk+8oQp0eaChp/ub7UO2aD4FQoR8cjRV1ErDkk/z2visrH bA8c9IvUk/6HdWdojYx44pxHzLFOmJVN51OkbTKaN76yNSLo0xE+ymtE/NPbUrwUNs d0RA8DGTUe2XuKKYjsYG28ZIhfyKYw5rIfQBfnce6bXd3R8/YrM6tWesiYlnsubQC5 aahpPWIgWP8AZ2xUU4eC/U7pVSoVv/HJTHChpEHzfSj4QLtpuhE6WMj/BQTSeaWxli KXJSAAt5Vp3pExR/voTo4B+t3fdvKqJ4jMBi2b1Oydg1b1878hIu05njBQY/aZrnSp Y5FV0sszQ8QJA== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH v1 1/6] ansible.cfg: Allow the use of alternate ssh ports Date: Thu, 2 Oct 2025 16:21:35 -0400 Message-ID: <20251002202140.3596787-2-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251002202140.3596787-1-cel@kernel.org> References: <20251002202140.3596787-1-cel@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Chuck Lever Users can now configure the Anisble SSH port via a new Kconfig menu option. The default remains port 22 (standard SSH) to avoid breaking existing setups. This configuration setting applies globally to all hosts in the Ansible inventory. The new port setting is not used yet. The review concern is whether the proposed new Kconfig option is the best user interface for this setting. Generated-by: Claude AI Signed-off-by: Chuck Lever --- kconfigs/Kconfig.ansible_cfg | 41 +++++++++++++++++++ .../ansible_cfg/templates/ansible.cfg.j2 | 3 ++ 2 files changed, 44 insertions(+) diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index c04532e818b1..e3fd02f18d2d 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -316,6 +316,47 @@ config ANSIBLE_CFG_INVENTORY endif # ANSIBLE_CFG_INVENTORY_CUSTOM +config ANSIBLE_CFG_SSH_PORT_SET_BY_CLI + bool + default $(shell, scripts/check-cli-set-var.sh ANSIBLE_CFG_SSH_PORT) + +config ANSIBLE_CFG_SSH_PORT_CUSTOM + bool "Enable a custom Ansible SSH port setting" + default n + help + When this setting is enabled, specify the SSH port for + Ansible to use when connecting to target nodes. + + When this setting is disabled, kdevops uses the default + SSH port (22), which can be overridden with + "ANSIBLE_CFG_SSH_PORT=NN" on the "make" command line. + + This is useful when your target hosts use a non-standard + SSH port for security or network configuration reasons. + +if ANSIBLE_CFG_SSH_PORT_CUSTOM + +config ANSIBLE_CFG_SSH_PORT + int "Ansible SSH port" + output yaml + help + Set the SSH port for Ansible to use when connecting to target + nodes. The default port is 22. + + https://docs.ansible.com/ansible/latest/collections/ansible/builtin/ssh_connection.html#parameter-remote_port + +endif # ANSIBLE_CFG_SSH_PORT_CUSTOM + +if !ANSIBLE_CFG_SSH_PORT_CUSTOM + +config ANSIBLE_CFG_SSH_PORT + int + output yaml + default 22 if !ANSIBLE_CFG_SSH_PORT_SET_BY_CLI + default $(shell, ./scripts/append-makefile-vars-int.sh $(ANSIBLE_CFG_SSH_PORT)) if ANSIBLE_CFG_SSH_PORT_SET_BY_CLI + +endif # !ANSIBLE_CFG_SSH_PORT_CUSTOM + if DISTRO_OPENSUSE config ANSIBLE_CFG_RECONNECTION_RETRIES diff --git a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 index f3f6c723f937..deb1a559dc2c 100644 --- a/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 +++ b/playbooks/roles/ansible_cfg/templates/ansible.cfg.j2 @@ -47,7 +47,10 @@ playbook_on_stats_msg_color = bright green [callback_profile_tasks] summary_only = true {% endif %} +[ssh_connection] +remote_port = {{ ansible_cfg_ssh_port }} {% if ansible_facts['distribution'] == 'openSUSE' %} + [connection] retries = {{ ansible_cfg_reconnection_retries }} {% endif %} -- 2.51.0