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 5EAE630DD1C for ; Tue, 2 Sep 2025 13:54: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=1756821287; cv=none; b=RdTXzj2Re5VK5l381f6oC45X32/WtpPvVnPviTGrSwQ0899F3HWDxZx9sxFgDlLz1cTdS6BCe1BSv2HDHfk35kdU9hyi8QA+hshWJ9TwZNHeAXXFyW0a51Md+gb6ceUAFD1Xi1pXy8pNCLRMjzMwK3BeEVZM3xw+VoU0/E0EowU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756821287; c=relaxed/simple; bh=6J/URPBSuX10YiaXicKkiuBhr/k1Cs8OqLrcXJe+Q4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nTWMaPtoX2hIOS/iuFt7y0E8fW22UIc1DuqLLdQ/prfvOvhWebMIKhbV40sF7kbrKZtPm1hhBjUMhzx3eR4RP7HAXMh0KROZnf2414T1tGiFV0c8wc/tTVdhmrKnVYLGIJCy2kr7HlopNR4A/NggyuPkDURSGcdPqHJ4NoGAV3A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M6pMnGjD; 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="M6pMnGjD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 017B6C4CEF5; 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=1756821287; bh=6J/URPBSuX10YiaXicKkiuBhr/k1Cs8OqLrcXJe+Q4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M6pMnGjDTHCLUew3j720SzuRrzQqrhPR1VofXaB/5P97JSkaF+9/ZWy6Od6Ev4M9+ d3cMmGsnehfHrddmp28TMEguF8h8PMtVOYp7ea/yZbkWlF/3zVNR8SZuaLrC5Lbtvf Q/mMfpENj5YftVPNiI3JMwx1Fvc6+JuJKavSA7wT5/XXGxuDFkOrBYR6IY5J+xZCtR KE4aEyDU5FG8qOSssl7Q6rVddPhFdwpuzACUaFYB3c62qJUY8jTIaGIVHWYPa8eKXL StvQEQQ79kSVJOFBdyNO7t7NRZcZMjTpyBgLLPoxw7uSv6nqGqqFyRj+85Vfcq2/EF ecdYc/H4ftJIA== From: Chuck Lever To: Cc: Chuck Lever Subject: [PATCH v2 37/37] inventory: generate the inventory pathname dynamically Date: Tue, 2 Sep 2025 09:54:24 -0400 Message-ID: <20250902135426.815079-38-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 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. Signed-off-by: Chuck Lever --- Makefile | 8 ++++++++ kconfigs/Kconfig.ansible_cfg | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/Makefile b/Makefile index f13d1f5c91ce..7d8b91f4c163 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