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 9706920DD51 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=OaCRZBQ3t7tFqUZ/KbCR3YwlOrl+CszCGx4QfoJ1lKPURVjnNhLwG09+xwfQacLyKettFfP4bA4Dnmc3l61x6aE/ty8Z9kggjOQv/G+rZJFRELpj9RpuachZkeM42M/eZSpy3Dwub3IQefBUZN6uVe927EV3iwxwvyA5yXjydxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756998947; c=relaxed/simple; bh=qEyHgOyZ9KjrBmRiudyf00IB7Vllotrwj6nhuJE+zWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q2crfUb6Ir6UnJ3e9G1LfylPIVrRdvYfzbt7lfPrhE/13gGG6qgEwPgoDy56K0Nn3F1GNx+y+dc+qwM8CZT7fm6fYUlWqChCVhuIKqWxsWnRiCKoxdUu9+RWXOCaFbnz0dKpUHsHufMqDBjwAyB02Cc4ttZt+2rSI/JQYLprC0o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KHgFZIbV; 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="KHgFZIbV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B5DCC4CEF6; Thu, 4 Sep 2025 15:15:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756998947; bh=qEyHgOyZ9KjrBmRiudyf00IB7Vllotrwj6nhuJE+zWc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KHgFZIbVSHA2wJmsfbgmMu58DGVojjnr5PsqQO/lvviN6N6PfzxAUgmzbSS18by7m lIIEcDuhBqsIEdZ2YOj+JJej/1w0sOGqnum6dHT2GYXagFaaq2h6mFEP8FNLZE9OIT lqDAe7uEiSZ2OZWRNfOE5OIOET0xOPqKu7Eug7qbIcmB44kt+BVvtLsWu977n+akFw kzi0srG3JjN8kEWGmbdgfO2vWuAbiG/leWFQG77HAwyO8eZWRw8iMeMhPMNyQwzLLE BKRZkUQ7cYl/7QVwANOpNmfddPeQXKOpB3E+Csgb1/9PrA2Ln9Vu6CxINrsiPCg5j0 hNGO8v+Kl8w7Q== From: Chuck Lever To: Cc: Chuck Lever , Luis Chamberlain Subject: [PATCH v3 36/36] inventory: generate the inventory pathname dynamically Date: Thu, 4 Sep 2025 11:15:24 -0400 Message-ID: <20250904151526.1596282-37-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 My CI workflows need the inventory location to be determined at run time, not set by the kdevops .config file, so the .configs can be portable amongst test runners and test branches. 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 3c48fea1421e..082e5744fc63 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,12 @@ else ANSIBLE_CFG_FILE := $(TOPDIR_PATH)/ansible.cfg export ANSIBLE_CONFIG := $(ANSIBLE_CFG_FILE) endif + +ifeq (y,$(CONFIG_ANSIBLE_CFG_INVENTORY_CUSTOM)) ANSIBLE_INVENTORY_FILE := $(shell echo $(CONFIG_ANSIBLE_CFG_INVENTORY) | tr --delete '"') +else +ANSIBLE_INVENTORY_FILE := $(TOPDIR_PATH)/hosts +endif KDEVOPS_INSTALL_TARGETS := @@ -92,6 +97,9 @@ 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 +ifneq (y,$(CONFIG_ANSIBLE_CFG_INVENTORY_CUSTOM)) +ANSIBLE_EXTRA_ARGS += ansible_cfg_inventory='$(ANSIBLE_INVENTORY_FILE)' +endif export KDEVOPS_HOSTS_TEMPLATE := hosts.j2 diff --git a/kconfigs/Kconfig.ansible_cfg b/kconfigs/Kconfig.ansible_cfg index 8b32d4986a76..a5812995c3fa 100644 --- a/kconfigs/Kconfig.ansible_cfg +++ b/kconfigs/Kconfig.ansible_cfg @@ -263,6 +263,16 @@ config ANSIBLE_CFG_TASK_DEBUGGER https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_debugger.html#id10 +config ANSIBLE_CFG_INVENTORY_CUSTOM + bool "Set a custom location for the Ansible inventory" + help + When this option is set to N, kdevops creates its + inventory file in a sensible default location. If it is + set to Y, you can set the path and filename of the Ansible + inventory. + +if ANSIBLE_CFG_INVENTORY_CUSTOM + config ANSIBLE_CFG_INVENTORY string "Ansible inventory sources" output yaml @@ -282,6 +292,8 @@ config ANSIBLE_CFG_INVENTORY For more details, refer to the Ansible documentation: https://docs.ansible.com/ansible/latest/reference_appendices/config.html#default-host-list +endif # ANSIBLE_CFG_INVENTORY_CUSTOM + if DISTRO_OPENSUSE config ANSIBLE_CFG_RECONNECTION_RETRIES -- 2.51.0