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 DC01630DD12 for ; Tue, 2 Sep 2025 13:54:46 +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=1756821286; cv=none; b=KthGYoQrjjVXIpp7H5Oo+A2MuhhXJVLdBPPX7iLXSWSRyzkx2B2CQJtBY6CuOswbVxxOonmvGeoJO/ZEzUncoNcdGJbkarlDExyO+BwN2C0ggTZr5lNf9EEPo7sLEM/Paq6wtoAOdo+LTQh40AITLCHCjCtTgEoUQHOFhob/NcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756821286; c=relaxed/simple; bh=zMYjTFBs1EnT8Ekwpjh1SRTbNGXdyef6osC/J6NSMrE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J/Fors2Xj+NZWn2l/au0UVI5t7tx3VUlbsOuy8t88s+xf0PtfgnPsyaSs4Zp1hFejaPci//EwW5wACnAoiIDPimuxGoyiEdktVKkPVXlXPWDjQYEvdvy6kxpgRhWxuLeSXpzvNYn5Su3OLISeucwiQo41JyV0Pp7mqivy0lexQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ne9t5DqX; 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="Ne9t5DqX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88227C4CEF7; Tue, 2 Sep 2025 13:54:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756821286; bh=zMYjTFBs1EnT8Ekwpjh1SRTbNGXdyef6osC/J6NSMrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ne9t5DqXEwU+qqpw1TvH7wDmE+/2y4X3ETe7SsvGiqrrhlweH0wd0YPd39pmxSpS4 2IYvHK7vwKPdVqYwNvydpf7dnFUbF8suWT/pbXIbLFRrz6M6OmTQERNuav+4OlzrGQ 2fPoQ3MpC4rEXNf/ACb7DV2tZtRg8mi2HX+G0daZXTLl3fr0mtZCpRfBshbolDIbmU z4qxoiwFBYgJZvOLPG2JdvWe5CtZFE6puCq+PfhEt/SF54L5SS8QQ/Qbn26jyRnCzm ZXzeKEVRtz9qegz6LA1aVpdoeYneD7Yl7hGik45KC2wGge4e6II+tydhCxijf3sbRZ PAYpVNTQIOhEQ== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH v2 36/37] ansible.cfg: generate an ansible.cfg file in TOPDIR Date: Tue, 2 Sep 2025 09:54:23 -0400 Message-ID: <20250902135426.815079-37-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250902135426.815079-1-cel@kernel.org> References: <20250902135426.815079-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. Signed-off-by: Chuck Lever --- Makefile | 8 ++++++++ kconfigs/Kconfig.ansible_cfg | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index a9cba02c0829..f13d1f5c91ce 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