chore: centralise all yum repo configuration
Build / precommit (pull_request) Successful in 5m43s

- add 30+ repository definitions to AlmaLinux/all_releases.yaml with `ensure: absent` defaults
- update all role-specific hieradata files to use `ensure: present` pattern
- remove duplicated repository URL/GPG key configurations from individual roles
- maintains existing functionality while improving maintainability"
This commit is contained in:
2026-01-11 16:22:08 +11:00
parent 6f51bffeaa
commit 24113f29e2
26 changed files with 306 additions and 437 deletions
+8 -5
View File
@@ -32,11 +32,14 @@ class profiles::yum::global (
$key_url = $repo['gpgkey']
$key_file = "/etc/pki/rpm-gpg/${name}-gpg-key"
exec { "download_gpg_key_${name}":
command => "curl -s -o ${key_file} ${key_url} && rpm --import ${key_file}",
path => ['/bin', 'usr/bin'],
creates => $key_file,
before => Yumrepo[$name],
# only download the key if the repo is present
if $repo['ensure'] == 'present' {
exec { "download_gpg_key_${name}":
command => "curl -s -o ${key_file} ${key_url} && rpm --import ${key_file}",
path => ['/bin', 'usr/bin'],
creates => $key_file,
before => Yumrepo[$name],
}
}
}
# create the repo