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 1007E199BC for ; Wed, 30 Jul 2025 06:22:40 +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=1753856561; cv=none; b=J0y+A+wbp5/3qh5S8k0qXs9pK6kPYFcDoLxzpWgtvlbeDI2DCw/q5OwhGmsFY/aWGeRzwBVs+0KWRzmvCCwOkVWMhENH/5vdgTqYk4JT810Ga/E5MBJpWaPFhHbGwOVH7d/uk4PXbAB0tmSo6qyVAiLcGL3BSgbvUtwVzOCJ6No= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1753856561; c=relaxed/simple; bh=5Up1oaQoZw+6L533T1af3rYIRvx57Parj2i1qmvv6t0=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=a1At1dJtWDVOScwjC1WVPbmmfiDUH/bLAGFqHX/9IzU67r2PXlNREBYJo+5efytLpGpu6LleZlQWBTQC0aexGs/EtQhDvExofeR1bq5ICig81ppLmUK48c2rKYH7jprhi1y+uOOLYXi48cSZcV65iF5RzqHnii8xEPUpACYzcT8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aOTJi6fC; 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="aOTJi6fC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0501C4CEE7; Wed, 30 Jul 2025 06:22:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1753856560; bh=5Up1oaQoZw+6L533T1af3rYIRvx57Parj2i1qmvv6t0=; h=Date:Reply-To:Subject:To:References:From:In-Reply-To:From; b=aOTJi6fCKidFui60sS4nQ5ZfSP2ATJgITVxyaGcGUMiIeEJW9xYcybI2F1Bb8uFO8 lf7PTVED6nBTVLyB9TRg48QFuImn3N+utY/w9M2aL829lFNWCOxArs/7Ttk6WSXinS 4ZD4BD2eTN8AprV2fakyoQgfiVNqp31l9MmkRzV48ESKV7BLnu0lyCBC/qrvNjKv8X JF8sV5nzCVqZO+0lv9YbkQjsKAG7dPfIR/hc2KQzXEQZsdSf740ZJ84J0JdWj2iuym eiSfNq7BQd/NduMMJml8hJiV94Bg++hLaJ7X83c7UbJ59k9fhKtxs91EZEy2moqiyz pKTVjGNyVlZPw== Message-ID: <2ecef063-ca92-48fc-9984-989306261dcb@kernel.org> Date: Wed, 30 Jul 2025 08:22:38 +0200 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: Daniel Gomez Subject: Re: [PATCH v2 2/9] Makefile: suppress Ansible warnings during configuration generation To: Luis Chamberlain , Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev References: <20250730060147.182140-1-mcgrof@kernel.org> <20250730060147.182140-3-mcgrof@kernel.org> Content-Language: en-US From: Daniel Gomez Organization: kernel.org In-Reply-To: <20250730060147.182140-3-mcgrof@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 30/07/2025 08.01, Luis Chamberlain wrote: > The initial configuration generation playbooks (ansible_cfg.yml, > gen_hosts.yml, and gen_nodes.yml) run without a proper inventory file > by design, as they are responsible for creating the configuration files > that will be used by subsequent playbooks. > > This causes Ansible to emit warnings about: > - "No inventory was parsed, only implicit localhost is available" > - "provided hosts list is empty, only localhost is available" > > These warnings are harmless but create noise in the build output, > potentially confusing users who might think something is wrong. Agree. > > Add ANSIBLE_LOCALHOST_WARNING=False and ANSIBLE_INVENTORY_UNPARSED_WARNING=False > environment variables to these three ansible-playbook invocations to > suppress these specific warnings. This makes the build output cleaner > while maintaining the same functionality. > > The warnings were appearing because: > 1. ansible_cfg.yml creates the ansible.cfg file > 2. gen_hosts.yml creates the hosts inventory file > 3. gen_nodes.yml creates the kdevops_nodes.yaml file > > All three intentionally run with "--connection=local" and minimal > inventory since they're bootstrapping the configuration that other > playbooks will use. > > Generated-by: Claude AI > Signed-off-by: Luis Chamberlain > --- > Makefile | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/Makefile b/Makefile > index 37c2522b..31f544e9 100644 > --- a/Makefile > +++ b/Makefile > @@ -195,7 +195,8 @@ include scripts/gen-nodes.Makefile > false) > > $(ANSIBLE_CFG_FILE): .config > - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ > + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ > + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ > --inventory localhost, \ > $(KDEVOPS_PLAYBOOKS_DIR)/ansible_cfg.yml \ > --extra-vars=@./.extra_vars_auto.yaml > @@ -226,13 +227,15 @@ endif > > DEFAULT_DEPS += $(ANSIBLE_INVENTORY_FILE) > $(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) > - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) \ > + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ > + ansible-playbook $(ANSIBLE_VERBOSE) \ > $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \ > --extra-vars=@./extra_vars.yaml > > DEFAULT_DEPS += $(KDEVOPS_NODES) > $(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_NODES_TEMPLATE) > - $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ > + $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ I think at this point we have the inventory file with all guests/hosts and the ansible.cfg. If that is correct I think we may not need to disable ANSIBLE_INVENTORY_UNPARSED_WARNING and ANSIBLE_LOCALHOST_WARNING here. And we can probably remove --connection=local and --inventory localhost, arguments. > + ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ > --inventory localhost, \ > $(KDEVOPS_PLAYBOOKS_DIR)/gen_nodes.yml \ > --extra-vars=@./extra_vars.yaml But in general it makes sense to enable these variables only for these specific ansible-playbook invocations. I initially thought we could inject them into the ansible.cfg and wrap ansible-playbook with the new environment, allowing subsequent invocations to leverage that. But we don't want the rest of the ansible-playbook runs to suppress these warnings, in case they do exist, as that would hide errors. Thanks! Reviewed-by: Daniel Gomez