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 4F2F42701B1 for ; Sun, 28 Sep 2025 19:53: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=1759089210; cv=none; b=mYelJXijbR8/0tW9iil1sHlDE7T9JuVwbfQUxIuB8Ae+li3qqUp2DWPWadYQOZOCnSCNQMsnhipupXZafUBn8splTNkey08dPiiRmNbWvde+0ydjzKETKeKehtQKLAlZBkAHa45uoc0PigghffuVhPWlnCLQvSL44qV3zX9mS7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759089210; c=relaxed/simple; bh=MyhEcrTNCHpdtNilnjfbsXFS6VMoSimy88knSKfJYKk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Y/aE+eHbk3cwq0VjgiuBOTQJrt6U68iHCxte+9iUJk4OIeHgZJUBx8ZyryTcohoo4hsAO6cXmwPNMQxHCYLJFJtdLSd/ueJMYjhklpuVHNhnGa3i5UpXIKWo516VdEecXQC5Vog9r57S9NKvWBXlJ4tKvCWXKG1CVpkl3hJxcA0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jPZ6e6Z4; 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="jPZ6e6Z4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CCC6C4CEF0; Sun, 28 Sep 2025 19:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1759089210; bh=MyhEcrTNCHpdtNilnjfbsXFS6VMoSimy88knSKfJYKk=; h=Date:Reply-To:Subject:To:Cc:References:From:In-Reply-To:From; b=jPZ6e6Z4DuVXpi54hj7O62Xx/YLDpEHyZ86razuiH/F7TNDYqPzhA/MgxGwYEK5sz kgiVA8199vMC6GjWuZ34OY7VLMrDW5678TleHSz7i0c9Ik3fXD+S3qPjk3G+ROH4un 7oEb6UBP19VkrxYavZhZKy4RFctb+JBnPJULynwGpd0Dk9sp++4t+KryTpVHnfCS0e OwQ4I3yQF3d6ybUuvGZxFV4/ZN94CWhsamQMwRQ7XA/PNbawgW1Ynnhbe7q1UMWYhu FDb1oXeaZf2EgOk2GtIPn6tXVX/e9bAzeFq4afk+grQ/kw2AI9rbpUFRTo8BXOb7zb goVXT6DCsfIFg== Message-ID: <827d1b8e-d489-46a9-a49b-b3cf3a4fe097@kernel.org> Date: Sun, 28 Sep 2025 21:53:27 +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: [RFC PATCH] Makefile: terraform wasn't building the kdevops_nodes file To: Chuck Lever Cc: kdevops@lists.linux.dev, Chuck Lever References: <20250928155341.901825-1-cel@kernel.org> Content-Language: en-US From: Daniel Gomez Organization: kernel.org In-Reply-To: <20250928155341.901825-1-cel@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 28/09/2025 17.53, Chuck Lever wrote: > From: Chuck Lever > > When "make bringup" runs "terraform plan", it complains that the > kdevops_nodes variable isn't set. > > extra_vars.yaml does contain the variable, but I'm guessing that > somehow gen_nodes runs after gen_tfvars now? Not really sure. I see! Thanks for reporting. Indeed my fix introduced this bug. I think it'd be best to move KDEVOPS_NODES just after we assign the filename to it (provision.Makefile -> guestfs.Makefile): diff --git a/Makefile b/Makefile index 3653591d..26615b22 100644 --- a/Makefile +++ b/Makefile @@ -144,16 +144,16 @@ endif DEFAULT_DEPS += $(ANSIBLE_CFG_FILE) DEFAULT_DEPS += $(ANSIBLE_INVENTORY_FILE) -ifneq (,$(KDEVOPS_NODES)) -DEFAULT_DEPS += $(KDEVOPS_NODES) -endif - include scripts/provision.Makefile include scripts/firstconfig.Makefile include scripts/systemd-timesync.Makefile include scripts/journal-server.Makefile include scripts/update_etc_hosts.Makefile +ifneq (,$(KDEVOPS_NODES)) +DEFAULT_DEPS += $(KDEVOPS_NODES) +endif + KDEVOPS_BRING_UP_DEPS += $(KDEVOPS_BRING_UP_DEPS_EARLY) KDEVOPS_BRING_UP_DEPS += $(KDEVOPS_PROVISIONED_DEVCONFIG) The patch below changes the proposed order (ansible.cfg -> hosts -> nodes -> rest) in patch 5457b742d611 to: ==> [/home/dagomez.linux/src/kdevops/ansible.cfg] ==> [guestfs/kdevops_nodes.yaml] ==> [/home/dagomez.linux/src/kdevops/hosts] I think both approaches work because nodes do not seem to be requiring hosts. The questions is whether we need both changes? I think we need to ensure nodes are consistent with inventory changes. And they other way around in case the user deletes any of the files. So, what do you think about adding this on top of the above? @@ -264,13 +264,13 @@ ifneq (,$(KDEVOPS_BRING_UP_DEPS)) include scripts/bringup.Makefile endif -$(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) $(KDEVOPS_EXTRA_VARS) +$(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) $(KDEVOPS_NODES) $(KDEVOPS_EXTRA_VARS) $(Q)ansible-playbook $(ANSIBLE_VERBOSE) --connection=local \ --inventory localhost, \ $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \ --extra-vars=@./extra_vars.yaml -$(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_NODES_TEMPLATE) $(KDEVOPS_EXTRA_VARS) +$(KDEVOPS_NODES): .config $(ANSIBLE_CFG_FILE) $(ANSIBLE_INVENTORY_FILE) $(KDEVOPS_NODES_TEMPLATE) $(KDEVOPS_EXTRA_VARS) Target result: make -j12 V=1 ==> [sudo] ==> [sudo] ==> [make] ==> [make] ==> [nc] ==> [nc] ==> [ansible-playbook] ==> [ansible-playbook] ==> [scripts/version_check/ansible-playbook] ==> [scripts/version_check/ansible-playbook] ==> [ansible-requirements] ==> [/home/dagomez.linux/src/kdevops/ansible.cfg] ==> [timesyncd-server] ==> [journal-server] ==> [.kdevops.depcheck] ==> [.kdevops.depcheck] ==> [guestfs/kdevops_nodes.yaml] ==> [/home/dagomez.linux/src/kdevops/hosts] > > Fixes: 5457b742d611 ("Makefile: fix target dependency order") > Signed-off-by: Chuck Lever > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index fb7e9b816dbc..c1dd1232c7ff 100644 > --- a/Makefile > +++ b/Makefile > @@ -258,7 +258,7 @@ ifneq (,$(KDEVOPS_BRING_UP_DEPS)) > include scripts/bringup.Makefile > endif > > -$(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) $(KDEVOPS_EXTRA_VARS) > +$(ANSIBLE_INVENTORY_FILE): .config $(ANSIBLE_CFG_FILE) $(KDEVOPS_HOSTS_TEMPLATE) $(KDEVOPS_NODES) $(KDEVOPS_EXTRA_VARS) > $(Q)ANSIBLE_LOCALHOST_WARNING=False ANSIBLE_INVENTORY_UNPARSED_WARNING=False \ > ansible-playbook $(ANSIBLE_VERBOSE) \ > $(KDEVOPS_PLAYBOOKS_DIR)/gen_hosts.yml \