mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 04:06:42 +00:00
The policy admits an Exception comment when it names a concrete trip-wire. Neither of these did. The compose one argued why the task delegates over query(node_hosts) instead of guarding on not IS_STACK_HOST; the loop with run_once already says every node, and the guard it warns about is not in the file to be misread. The dnf-mirrors one explained why the SIG repository needs its own sed, directly above a sed whose own path carries SIGs/<stream>/extras/<arch>/extras-common. Both came from155b35ec54and59840c3362earlier today. The reasoning stays in those commit messages, which is where it belongs. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
25 lines
716 B
Bash
Executable File
25 lines
716 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
shopt -s nullglob
|
|
repos=(/etc/yum.repos.d/*.repo)
|
|
if [[ ${#repos[@]} -eq 0 ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
upstream='https://mirror.stream.centos.org'
|
|
|
|
# Param: $1 repo id as the metalink query spells it, $2 directory on the upstream
|
|
for_repo() {
|
|
sed -i -E \
|
|
"s#^metalink=https?://mirrors\\.centos\\.org/metalink\\?repo=centos-$1-([^-&]+)-stream.*#baseurl=$upstream/\\1-stream/$2/\\\$basearch/os/#" \
|
|
"${repos[@]}"
|
|
}
|
|
|
|
for_repo baseos BaseOS
|
|
for_repo appstream AppStream
|
|
|
|
sed -i -E \
|
|
"s#^metalink=https?://mirrors\\.centos\\.org/metalink\\?repo=centos-extras-sig-extras-common-([^-&]+)-stream.*#baseurl=$upstream/SIGs/\\1-stream/extras/\\\$basearch/extras-common/#" \
|
|
"${repos[@]}"
|