fix: yumrepo purging

This commit is contained in:
2024-06-14 23:48:05 +10:00
parent 380bb7bcb5
commit 67f831edaf
3 changed files with 18 additions and 10 deletions
-1
View File
@@ -34,7 +34,6 @@ class profiles::defaults {
ensure => 'present',
enabled => 1,
gpgcheck => 1,
mirrorlist => 'absent',
require => Class['profiles::pki::vaultca'],
notify => Exec['dnf_makecache'],
}
+10 -9
View File
@@ -16,12 +16,12 @@ class profiles::yum::global (
purge => $purge,
}
exec {'purge_almalinux_default_repos':
command => 'rm -f /etc/yum.repos.d/almalinux*.repo',
path => ['/bin', '/usr/bin'],
onlyif => 'find /etc/yum.repos.d/ -type f -name *almalinux* | grep .',
before => Resources['yumrepo'],
}
#exec {'purge_almalinux_default_repos':
# command => 'rm -f /etc/yum.repos.d/almalinux*.repo',
# path => ['/bin', '/usr/bin'],
# onlyif => 'find /etc/yum.repos.d/ -type f -name *almalinux* | grep .',
# before => Resources['yumrepo'],
#}
# download all gpg keys if a repo defines it
$repos.each |$name, $repo| {
@@ -36,11 +36,12 @@ class profiles::yum::global (
before => Yumrepo[$name],
}
}
# create the repo
yumrepo { $name:
* => $repo,
}
}
# create repos
create_resources('yumrepo', $repos)
# makecache if changes made to repos
exec {'dnf_makecache':
command => 'dnf makecache -q',