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 44E33353343 for ; Tue, 2 Sep 2025 20:14:01 +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=1756844041; cv=none; b=dXksbwCCHGRv9FUJSHbMePwJ/Suw1VkaActVTubEYV24Pxxn5E41qlNXUCr8dcDDQf6j4++g4zj4zEa5teMe+W8w/bpuH99fPld84SgXtzlgPz7Og+rpd1k2d75gj0MHQq0TdUvOlGK2S1OZ97iFeBPDlvPc7oXpnWM06A5Gytc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756844041; c=relaxed/simple; bh=KqMFaz47Wm10FFEF46INl1df80AIa8yZDGRUKqb9G58=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oD/CNwn3INx//oE1Xta3Kus5fII7ieUwHG2pJNqE2cjMV0UOIujeqYMtupsWigDB+BlBDwDiuP1Dwf/ocx16KC3GH6GlCyyjyzBVNzH05TMX99jfil2MOSbzeK0UsoAWff74/yeavsuVuvwjushK4y5fPZS7ShZNZuLpTvEZASs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iEJrcf2Y; 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="iEJrcf2Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83569C4CEED; Tue, 2 Sep 2025 20:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1756844040; bh=KqMFaz47Wm10FFEF46INl1df80AIa8yZDGRUKqb9G58=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=iEJrcf2YZdvtgZ5YaXhRYe0UXmzzc7QtnYjYvZcbNmpYE1QBX5UwXU42JNQTVvaEs 2YS2R47yjpDdBExncdrncQzjFjZXcyWmnLJ0nhR8MCERZ9q2BkwKNbzUZwrZYoeDS/ IMVjcA7A05IRnO9PSW04qpekN8VOmvIm3573iZVbP2vcMffBwePju6oGxptA7gYCAC s72S87NKCWtACz8P8QoXifRqsUza4/PlU8k+sLFwdcFjhKSTfHiT6MwJkxtlXmOZZJ ft4dSjGxgPB3vSHiKZ6/9pPYu2tQIhk5B6OAyjHQo2MPTbkBH+V6Ioks31/oc/StaM I+jSkrCupiJnQ== Message-ID: <10497d0d-217b-48e8-ab68-d14be8792dd5@kernel.org> Date: Tue, 2 Sep 2025 16:13:59 -0400 Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 26/37] Add an Ansible requirements.yml file To: Daniel Gomez , kdevops@lists.linux.dev Cc: Chuck Lever , Luis Chamberlain References: <20250902135426.815079-1-cel@kernel.org> <20250902135426.815079-27-cel@kernel.org> Content-Language: en-US From: Chuck Lever Organization: kernel.org In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 9/2/25 4:06 PM, Daniel Gomez wrote: > On 02/09/2025 15.54, Chuck Lever wrote: >> From: Chuck Lever >> >> Commit b90d89d27659 ("Switch to the cloud.terraform.terraform >> module") introduced the use of the cloud.terraform module, and >> commit 7ccb64834eeb ("guestfs: Replace scripts/destroy_guestfs.sh >> with an Ansible playbook") introduced the use of the >> community.libvirt module. It would be friendly if kdevops could >> pull in the Ansible modules it needs transparently. >> >> The requirements.yml file is a manifest of Ansible collections that >> the project needs to run. Installation of these collections is made >> automatic by adding: >> >> ansible-galaxy install -r requirements.yml >> >> to the "make ansible_cfg" step. This mechanism can keep cached >> versions of collections up to date, and can also constrain a >> cached collection to a specific version, if that's needed. > > I don't see the link between the galaxy step and the ansible_cfg target in the > changes below. AIUI, just the requirements.yml file itself is not enough. The "ansible-galaxy install" step is needed to actually do the install. It's arguable whether the ansible_cfg target is the best place to handle it, but that target is done quite early. Suggestions are welcome! > But in case we have it, I think this should be distro specific. > Last time I checked, all these galaxy dependencies are provided in Debian by the > ansible package. So it's not needed there. On my systems, some of the packaged versions of the collections are already installed anyway. But on some they are not. It's better to not have to keep track of whether the distros provide these or whether they are installed. We document the requirements in requirements.yml, and the rest is handled automatically (and declaratively). >> The initial file contains requirements I could find easily, and >> should be updated over time as new collection dependencies are >> introduced. >> >> See also: >> >> https://docs.ansible.com/ansible/latest/user_guide/collections_using.html >> >> Reviewed-by: Luis Chamberlain >> Signed-off-by: Chuck Lever >> --- >> requirements.yml | 8 ++++++++ >> scripts/ansible.Makefile | 5 +++++ >> 2 files changed, 13 insertions(+) >> create mode 100644 requirements.yml >> >> diff --git a/requirements.yml b/requirements.yml >> new file mode 100644 >> index 000000000000..a22691d3f86b >> --- /dev/null >> +++ b/requirements.yml >> @@ -0,0 +1,8 @@ >> +--- >> +collections: >> + - name: ansible.posix >> + - name: ansible.utils >> + - name: cloud.terraform >> + - name: community.docker >> + - name: community.general >> + - name: community.libvirt >> diff --git a/scripts/ansible.Makefile b/scripts/ansible.Makefile >> index b0d2a8c12ee7..4efcf3e93b0e 100644 >> --- a/scripts/ansible.Makefile >> +++ b/scripts/ansible.Makefile >> @@ -2,3 +2,8 @@ >> >> AV ?= 0 >> export ANSIBLE_VERBOSE := $(shell scripts/validate_av.py --av "$(AV)") >> + >> +ansible-requirements: >> + @$(Q)ansible-galaxy install -r requirements.yml > > Can you remove the "@"? That is controlled by the $(Q) var. I copied that from elsewhere. It can be removed. >> +PHONY += ansible-requirements >> +DEFAULT_DEPS += ansible-requirements -- Chuck Lever