public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
* [RFC PATCH v1] Add an Ansible requirements.yml file
@ 2025-08-24 16:23 Chuck Lever
  2025-08-25  8:38 ` Luis Chamberlain
  0 siblings, 1 reply; 4+ messages in thread
From: Chuck Lever @ 2025-08-24 16:23 UTC (permalink / raw)
  To: kdevops; +Cc: Chuck Lever

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.

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

Question: Can we assume that the Ansible controller has internet
access all the time?

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
+PHONY += ansible-requirements
+DEFAULT_DEPS += ansible-requirements
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-08-25 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-24 16:23 [RFC PATCH v1] Add an Ansible requirements.yml file Chuck Lever
2025-08-25  8:38 ` Luis Chamberlain
2025-08-25 12:03   ` Daniel Gomez
2025-08-25 14:16   ` Chuck Lever

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox