Introduce a new matrix_container_global_registry_prefix_override variable and make all roles respect it

`matrix_container_global_registry_prefix_override` may look similar to
the old `matrix_container_global_registry_prefix` variable
(removed in d6bf789710), but it's different.

The old `matrix_container_global_registry_prefix` variable was just a hardcode of `docker.io/` and roles that
needed to refer to `docker.io/` could use it. However, this was:

- not used by all roles, because some need another registry (not `docker.io/`)
- used only by roles within the playbook (`roles/custom`), not external roles

Overriding the old `matrix_container_global_registry_prefix` variable was rather pointless,
as it didn't cover everything.

The new `matrix_container_global_registry_prefix_override` variable, on the other hand,
lets you override the registry prefix for all components, regardless of whether they
use `docker.io/` or another registry by default.

This is useful to people who have somehow mirrored all container images to their own registry,
as it provides them with a single variable they can flip to influence the whole playbook.
This commit is contained in:
Slavi Pantaleev
2025-02-24 11:18:05 +02:00
parent c47eca389b
commit b88b6ae7a3
5 changed files with 242 additions and 33 deletions

View File

@ -136,6 +136,13 @@ matrix_architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ('arm6
# We just remap from our `matrix_architecture` values to what Debian and possibly other distros call things.
matrix_debian_arch: "{{ 'armhf' if matrix_architecture == 'arm32' else matrix_architecture }}"
# If specified, the playbook will override the default registry prefix for all components.
#
# This is to be used when you've mirrored all the necessary container images (from their respective registries) by yourself.
#
# Example value: "registry.example.com/" (note the trailing `/`).
matrix_container_global_registry_prefix_override: ""
matrix_user_username: "matrix"
matrix_user_groupname: "matrix"