public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Daniel Gomez <da.gomez@kernel.org>, kdevops@lists.linux.dev
Cc: Chuck Lever <chuck.lever@oracle.com>,
	Luis Chamberlain <mcgrof@kernel.org>
Subject: Re: [PATCH v2 26/37] Add an Ansible requirements.yml file
Date: Tue, 2 Sep 2025 16:13:59 -0400	[thread overview]
Message-ID: <10497d0d-217b-48e8-ab68-d14be8792dd5@kernel.org> (raw)
In-Reply-To: <d092c6c4-de24-452e-a5bd-dbb6d4855929@kernel.org>

On 9/2/25 4:06 PM, Daniel Gomez wrote:
> On 02/09/2025 15.54, Chuck Lever wrote:
>> From: Chuck Lever <chuck.lever@oracle.com>
>>
>> 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 <mcgrof@kernel.org>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> ---
>>  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

  reply	other threads:[~2025-09-02 20:14 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02 13:53 [PATCH v2 00/37] Various fixes Chuck Lever
2025-09-02 13:53 ` [PATCH v2 01/37] scripts: Update gen_ssh_key.sh Chuck Lever
2025-09-02 13:53 ` [PATCH v2 02/37] terraform/azure: Fix count of managed disks Chuck Lever
2025-09-02 13:53 ` [PATCH v2 03/37] terraform/azure: Remove tags from terraform configuration Chuck Lever
2025-09-02 13:53 ` [PATCH v2 04/37] terraform/azure: Enable network acceleration Chuck Lever
2025-09-02 13:53 ` [PATCH v2 05/37] terraform/azure: Make the resource group name a variable Chuck Lever
2025-09-02 13:53 ` [PATCH v2 06/37] terraform/azure: Remove the provider version constraint Chuck Lever
2025-09-02 13:53 ` [PATCH v2 07/37] terraform/azure: Update the RHEL publishers Chuck Lever
2025-09-02 13:53 ` [PATCH v2 08/37] terraform/oci: Work around oracle/oci provider bug Chuck Lever
2025-09-02 13:53 ` [PATCH v2 09/37] terraform/oci: Add Kconfig choices for disk performance provisioning Chuck Lever
2025-09-02 13:53 ` [PATCH v2 10/37] terraform/oci: Enable preemptible compute instances Chuck Lever
2025-09-02 13:53 ` [PATCH v2 11/37] terraform/aws: Fix zone selection for us_west1 Chuck Lever
2025-09-02 13:53 ` [PATCH v2 12/37] Revert "terraform/aws: Add Oracle Linux AMI selections" Chuck Lever
2025-09-02 13:54 ` [PATCH v2 13/37] terraform/aws: Remove unused terraform tags Chuck Lever
2025-09-02 13:54 ` [PATCH v2 14/37] terraform/GCE: Fix the default disk throughput values Chuck Lever
2025-09-02 13:54 ` [PATCH v2 15/37] terraform/gce: Remove unused tags Chuck Lever
2025-09-02 13:54 ` [PATCH v2 16/37] terraform/gce: Remove support for Fedora Chuck Lever
2025-09-02 13:54 ` [PATCH v2 17/37] terraform/gce: Update existing machine types and introduce new ones Chuck Lever
2025-09-02 13:54 ` [PATCH v2 18/37] terraform: Create the user's .ssh/config if it does not already exist Chuck Lever
2025-09-02 13:54 ` [PATCH v2 19/37] pynfs: Don't install xdrlib3 on older RHEL Chuck Lever
2025-09-02 13:54 ` [PATCH v2 20/37] guestfs: Update the guestfs playbook description Chuck Lever
2025-09-02 19:36   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 21/37] gen_hosts: Add 'localhost' to the [all] group Chuck Lever
2025-09-02 19:39   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 22/37] gen_hosts: Add [service] group to the builder host template Chuck Lever
2025-09-02 19:43   ` Daniel Gomez
2025-09-02 19:47     ` Chuck Lever
2025-09-02 20:38       ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 23/37] guestfs: Don't run the 'destroy' tags on the controller Chuck Lever
2025-09-02 19:54   ` Daniel Gomez
2025-09-02 19:59     ` Chuck Lever
2025-09-02 20:40       ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 24/37] base_image: Skip "locales-all" package on Fedora Chuck Lever
2025-09-02 19:57   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 25/37] update_etc_hosts: ipaddr Chuck Lever
2025-09-02 19:59   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 26/37] Add an Ansible requirements.yml file Chuck Lever
2025-09-02 20:06   ` Daniel Gomez
2025-09-02 20:13     ` Chuck Lever [this message]
2025-09-02 13:54 ` [PATCH v2 27/37] terraform/oci: Clean up white space in route table resource Chuck Lever
2025-09-02 20:10   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 28/37] guestfs: Correct the spelling of "drives" Chuck Lever
2025-09-02 20:14   ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 29/37] guestfs: Configure how many extra drives to provision Chuck Lever
2025-09-02 20:19   ` Daniel Gomez
2025-09-02 20:23     ` Chuck Lever
2025-09-02 13:54 ` [PATCH v2 30/37] ltp: Replace /opt with a symlink to data partition Chuck Lever
2025-09-02 13:54 ` [PATCH v2 31/37] terraform: Squelch Ansible complaints about missing inventory file Chuck Lever
2025-09-02 13:54 ` [PATCH v2 32/37] terraform: Skip localhost when waiting for targets to reboot Chuck Lever
2025-09-02 13:54 ` [PATCH v2 33/37] devconfig: include the "service" group in the playbooks hosts list Chuck Lever
2025-09-02 20:27   ` Daniel Gomez
2025-09-02 20:30     ` Chuck Lever
2025-09-02 20:45       ` Daniel Gomez
2025-09-02 13:54 ` [PATCH v2 34/37] Makefile: Remove CONFIG_TOPDIR_PATH_HAS_SHA256SUM Chuck Lever
2025-09-02 13:54 ` [PATCH v2 35/37] Makefile: Set TOPDIR_PATH and generate its sha256sum at run time Chuck Lever
2025-09-02 13:54 ` [PATCH v2 36/37] ansible.cfg: generate an ansible.cfg file in TOPDIR Chuck Lever
2025-09-02 13:54 ` [PATCH v2 37/37] inventory: generate the inventory pathname dynamically Chuck Lever
2025-09-02 15:24 ` [PATCH v2 00/37] Various fixes Luis Chamberlain
2025-09-02 20:34 ` Daniel Gomez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10497d0d-217b-48e8-ab68-d14be8792dd5@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=da.gomez@kernel.org \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox