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 82DFB30CD84 for ; Thu, 28 Aug 2025 20:28:30 +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=1756412910; cv=none; b=HgMf+/8DQj54rR+PZGaIkgoVtaaZXmr15jeUp3FE2HYowfZQ1JflllfzPqAluO6QKYxnh68lRNXySNhJuyFIktvFJ+qCPazjHo7mZeaWEryE2qyeIyJeoUXShcIhIRSCYDZzqVXXtNIDmZZl6VHy6IwKKi5qAN4g1OtFGQXTjtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756412910; c=relaxed/simple; bh=zJ/KZn9Z6IcTRMzgeYhuPTrwcdszzAdpoNKXwQkeHMM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HjDskz7LRirkXMEu0vzHKp8xoQqx2TqfDJtBwVP7B0SrIMBtByRpOI8DD5/B1tebqlWInWFiGCiaunAnmaiuAn6tYmgwDS5zU0A41bo4Tu5Jq6Xbj7nPG42On16DTy4EXiZ0LpvrPVCzbGh0frhKplbB4wvV5CkTggpg1oxzZME= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YFd7PiT2; 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="YFd7PiT2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8DF3C4CEEB; Thu, 28 Aug 2025 20:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756412910; bh=zJ/KZn9Z6IcTRMzgeYhuPTrwcdszzAdpoNKXwQkeHMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YFd7PiT2WYNnHPmyL04c8zYFDqxX4iOQJp5yXyJ1+SWVJgSPsTtE0br8PPXExQ4Mz /U4MBfCJhN2uXCZTA1OmRYgn2NuiczXOqapU+yIplciB0czb0jaW8JaGejsqkuFM/j 2mel+315C2N2pZxE77dmnAJ0pI19IQqABUF3kLCnb8ufKIcdw+XAppPsBdCsavUUCc 6+HHJwrXw9HoBynexFwFtpHyxAJUvhk2g7rMpC+LGN/CM7r0rm/nKNOHryXgBspe// Tro7molwvmJXh2dVRDpsfpO7YBMZxncYggBURVOfISI5DtNdSxNr7IaiT9bIT13OZh yfH4kfsqTjDtg== From: Chuck Lever To: Cc: Chuck Lever Subject: [RFC PATCH 2/2] ansible.cfg: generate an ansible.cfg file in TOPDIR Date: Thu, 28 Aug 2025 16:28:27 -0400 Message-ID: <20250828202827.3253499-3-cel@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250828202827.3253499-1-cel@kernel.org> References: <20250828202827.3253499-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 b6fdbe67fc07..b014faa5632e 100644 --- a/Makefile +++ b/Makefile @@ -27,10 +27,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_DEFAULT)) +ANSIBLE_CFG_FILE := $(TOPDIR_PATH)/ansible.cfg +export ANSIBLE_CONFIG := $(ANSIBLE_CFG_FILE) +else ifneq ($(strip $(CONFIG_ANSIBLE_CFG_FILE)),) ANSIBLE_CFG_FILE := $(shell echo $(CONFIG_ANSIBLE_CFG_FILE) | tr --delete '"') export ANSIBLE_CONFIG := $(ANSIBLE_CFG_FILE) endif +endif ANSIBLE_INVENTORY_FILE := $(shell echo $(CONFIG_ANSIBLE_CFG_INVENTORY) | tr --delete '"') KDEVOPS_INSTALL_TARGETS := @@ -86,6 +91,9 @@ CFLAGS += $(INCLUDES) ANSIBLE_EXTRA_ARGS += kdevops_version='$(PROJECTRELEASE)' ANSIBLE_EXTRA_ARGS += topdir_path_has_sha256sum='$(TOPDIR_PATH_HAS_SHA256SUM)' ANSIBLE_EXTRA_ARGS += topdir_path_sha256sum='$(TOPDIR_PATH_SHA256SUM)' +ifeq (y,$(CONFIG_ANSIBLE_CFG_FILE_DEFAULT)) +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..a44f760912cf 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_DEFAULT + bool "Use a sensible default location for the ansible.cfg file" + default N + help + When this option is set to Y, kdevops creates an ansible.cfg + in a sensible default location, using the settings defined + in this Kconfig menu. + +if !ANSIBLE_CFG_FILE_DEFAULT + 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_DEFAULT + menu "Ansible Callback Plugin Configuration" choice prompt "Ansible Callback Plugin" -- 2.51.0