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 101592367DC for ; Thu, 4 Sep 2025 15:15:47 +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=1756998947; cv=none; b=N3c7D7qsnjySDJcXcL0b3EIqTRWyrLIjXGrxWOhbHj1XsokZ2T1p1BihHglr0Lx1k46oQ9avQnHwkO41xWDlXyiALlo0b80GwGVdtz9VxL92O4PdUkCSZhRb6QCW2dM+LYuyTY59HuN51Pn7yv97QSGSPhg+fLGzeyUZ7OkWmK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756998947; c=relaxed/simple; bh=vJfRIQ08ayf6NaOLkiB3E9of45paL582AO33VRLuJyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e2OE1cwsrj3SLCvQb+SN/11ZAJb3+QHXsCtb272g3+gaEeJ5/V0eA02+IO6IfR38yUNuHBoLiMYP9Bx8cr1KmJgxHDKLdi0yxHmFnsTm0GhetmfWZKlW+iEZgvVFttcoP79YaTy5ULdhHctBNTTy/gZB4GH9DedjdVo/VZZF7J8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fZ8ITmxc; 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="fZ8ITmxc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0351C4CEF0; Thu, 4 Sep 2025 15:15:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756998946; bh=vJfRIQ08ayf6NaOLkiB3E9of45paL582AO33VRLuJyo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fZ8ITmxcDQcVRDL4mnRya567J4uYMiWaFsaVYTxYiTOcqtdSwmy6249WAAtgJ/UnO aOcPzzac3p5r1jQOAHBxkFxBa1SJQSZ9WwpbPNThNlbN8JXFVE3NBxKEu7rJOufVrb eJr0rri0haR44VPEuaLyZ8OFk3KPvTm4QUNnJGOkYU0ATYynt8cU9RPgfr1RrfxyVH S4kuGyMl6d8BbqUO1npfZVLwh+SvUU8jFk9ZyDDQHkSag6B870JraqVYs9fYoxKzF/ EP57kdshIcv5I2Kl+XrA62ioxWVUOZM+wOL+uCxkJJZ3XyE7e0BT3ciwTssr7mmMc2 dvB8dEtl17cpQ== From: Chuck Lever To: Cc: Chuck Lever , Luis Chamberlain Subject: [PATCH v3 35/36] ansible.cfg: generate an ansible.cfg file in TOPDIR Date: Thu, 4 Sep 2025 11:15:23 -0400 Message-ID: <20250904151526.1596282-36-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250904151526.1596282-1-cel@kernel.org> References: <20250904151526.1596282-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 I need an ansible.cfg that is generated by the Kconfig menu, but whose pathname is selected dynamically based on where kdevops is being run rather than having that path baked into the .config. Reviewed-by: Luis Chamberlain Signed-off-by: Chuck Lever --- Makefile | 8 ++++++++ kconfigs/Kconfig.ansible_cfg | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index 7230c2871d4d..3c48fea1421e 100644 --- a/Makefile +++ b/Makefile @@ -26,10 +26,15 @@ KDEVOPS_NODES_ROLE_TEMPLATE_DIR := $(KDEVOPS_PLAYBOOKS_DIR)/roles/gen_nodes/tem export KDEVOPS_NODES_TEMPLATE := export KDEVOPS_MRPROPER := +ifeq (y,$(CONFIG_ANSIBLE_CFG_FILE_CUSTOM)) ifneq ($(strip $(CONFIG_ANSIBLE_CFG_FILE)),) ANSIBLE_CFG_FILE := $(shell echo $(CONFIG_ANSIBLE_CFG_FILE) | tr --delete '"') export ANSIBLE_CONFIG := $(ANSIBLE_CFG_FILE) endif +else +ANSIBLE_CFG_FILE := $(TOPDIR_PATH)/ansible.cfg +export ANSIBLE_CONFIG := $(ANSIBLE_CFG_FILE) +endif ANSIBLE_INVENTORY_FILE := $(shell echo $(CONFIG_ANSIBLE_CFG_INVENTORY) | tr --delete '"') KDEVOPS_INSTALL_TARGETS := @@ -84,6 +89,9 @@ CFLAGS += $(INCLUDES) ANSIBLE_EXTRA_ARGS += kdevops_version='$(PROJECTRELEASE)' ANSIBLE_EXTRA_ARGS += topdir_path_sha256sum='$(TOPDIR_PATH_SHA256SUM)' +ifneq (y,$(CONFIG_ANSIBLE_CFG_FILE_CUSTOM)) +ANSIBLE_EXTRA_ARGS += ansible_cfg_file='$(ANSIBLE_CFG_FILE)' +endif export KDEVOPS_HOSTS_TEMPLATE := hosts.j2 diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index dbd189f5d19e..8b32d4986a76 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -18,6 +18,16 @@ config ANSIBLE_CFG_INVENTORY_SET_BY_CLI bool default $(shell, scripts/check-cli-set-var.sh KDEVOPS_HOSTS) +config ANSIBLE_CFG_FILE_CUSTOM + bool "Set a custom location for the ansible.cfg file" + help + When this option is set to N, kdevops creates an ansible.cfg + in a sensible default location, using the settings defined + in this Kconfig menu. If it is set to Y, you can set the + path and filename of the Ansible configuration file. + +if ANSIBLE_CFG_FILE_CUSTOM + config ANSIBLE_CFG_FILE string "Ansible configuration file" output yaml @@ -41,6 +51,8 @@ config ANSIBLE_CFG_FILE For more details, refer to the Ansible documentation: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#the-configuration-file +endif # ANSIBLE_CFG_FILE_CUSTOM + menu "Ansible Callback Plugin Configuration" choice prompt "Ansible Callback Plugin" -- 2.51.0