artifactapi module: support mirrorlist on rpm/apk(alpine) remotes #24

Merged
benvin merged 1 commits from benvin/mirrorlist-config into main 2026-08-13 19:54:03 +10:00
Member

Why

The artifactapi Terraform provider v0.5.0 (now on the artifactapi terraform registry) adds a mirrorlist field on remote rpm/deb/apk(alpine) repos — extra upstream mirror base URLs that are load-balanced with failover across base_url + mirrorlist. This teaches the config module to accept and pass it through so a future PR can enable it on a real remote (e.g. fedora).

How

  • modules/artifactapi/variables.tf: add mirrorlist = optional(list(string), []) to the remote_rpm and remote_alpine object variables only.
  • modules/artifactapi/main.tf: pass mirrorlist = each.value.mirrorlist into artifactapi_remote_rpm and artifactapi_remote_alpine.
  • modules/artifactapi/versions.tf: bump the artifactapi provider constraint 0.2.0 -> ~> 0.5.

Notes

  • Additive and optional — existing configs without the key still validate (default []).
  • Scoped to rpm/apk only: docker/pypi/helm/generic/goproxy/terraform remotes are untouched. This module has no deb remote type, so nothing to add there.
  • mirror_strategy was intentionally omitted: provider v0.5.0's schema exposes only mirrorlist, not a strategy attribute (verified via terraform providers schema). Adding it would break validate. If a strategy field lands in a later provider release, it can be plumbed as a follow-up.
  • No config/remote_*/ file changed — enabling mirrorlist on an actual remote (e.g. fedora) is a deliberate follow-up.

Validation

terraform init resolved provider v0.5.0 from the artifactapi registry; terraform validate = Success, terraform fmt -check clean, tflint clean.

## Why The artifactapi Terraform provider **v0.5.0** (now on the artifactapi terraform registry) adds a `mirrorlist` field on remote rpm/deb/apk(alpine) repos — extra upstream mirror base URLs that are load-balanced with failover across `base_url` + `mirrorlist`. This teaches the config module to accept and pass it through so a future PR can enable it on a real remote (e.g. fedora). ## How - `modules/artifactapi/variables.tf`: add `mirrorlist = optional(list(string), [])` to the **remote_rpm** and **remote_alpine** object variables only. - `modules/artifactapi/main.tf`: pass `mirrorlist = each.value.mirrorlist` into `artifactapi_remote_rpm` and `artifactapi_remote_alpine`. - `modules/artifactapi/versions.tf`: bump the `artifactapi` provider constraint `0.2.0` -> `~> 0.5`. ## Notes - Additive and optional — existing configs without the key still validate (default `[]`). - Scoped to rpm/apk only: docker/pypi/helm/generic/goproxy/terraform remotes are untouched. This module has no `deb` remote type, so nothing to add there. - **`mirror_strategy` was intentionally omitted**: provider v0.5.0's schema exposes only `mirrorlist`, not a strategy attribute (verified via `terraform providers schema`). Adding it would break `validate`. If a strategy field lands in a later provider release, it can be plumbed as a follow-up. - No `config/remote_*/` file changed — enabling mirrorlist on an actual remote (e.g. fedora) is a deliberate follow-up. ## Validation `terraform init` resolved provider **v0.5.0** from the artifactapi registry; `terraform validate` = Success, `terraform fmt -check` clean, `tflint` clean.
unkin-agent added 1 commit 2026-08-13 17:40:40 +10:00
artifactapi module: support mirrorlist on rpm/apk(alpine) remotes
ci/woodpecker/pr/plan Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
c21beda154
Expose the provider v0.5.0 mirrorlist field through the config module so
rpm and alpine(apk) remotes can declare extra upstream mirror base URLs
(load-balanced with failover across base_url + mirrorlist).

- remote_rpm / remote_alpine object vars gain mirrorlist = optional(list(string), [])
- pass mirrorlist through to the corresponding remote resources
- bump artifactapi provider constraint to ~> 0.5

Additive and optional; no real remote config changes (deferred follow-up).
benvin merged commit 6c4b37ff17 into main 2026-08-13 19:54:03 +10:00
benvin deleted branch benvin/mirrorlist-config 2026-08-13 19:54:03 +10:00
Sign in to join this conversation.