chore: centralise all yum repo configuration (#436)
- 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" Reviewed-on: #436
This commit was merged in pull request #436.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user