Like many sites, we have internal yum repos that contain our internally-created rpms, as well as some other repos that are internal mirrors of upstream sites (centos updates, etc.). We're running into an ordering issue that I'm looking for what the current suggested best practice is....
We cooked up a 'my-mirrors-release' rpm notionally like 'epel-release' or 'centos-release' etc. that you'd commonly see. Contents are the /etc/yum.repos.d files for the various internal repos, and some /etc/pki gpg keys for the repos that have signed rpms. Typical yum repo stuff.
Question is how to ensure that our local mirrors-release rpm installs before any other rpms that would need to have the repo defined in order to find the rpms therein. In other words we want this rpm installed first. Like 'really' first
We're trying to avoid having to specify having the my-mirrors-release rpm be installed before rpmXYZ every time we specify a rpm to be installed in all the places we might want to specify a package be installed. Looking for suggestions for a current best practice (assume puppet 3.8 but if there's 4.0 magic, that would be good to know)
One solution we came up with is the bottom line in the code snippet below. Is this today's best practice for this kind of thing ? Again - we're trying to ensure this 'one' rpm is there before installing later rpms that would depend on it. Suggestions ?
class myprofiles::my_mirrors {
# disable upstream repos
yumrepo { 'updates': enabled => 0, }
# enable our mirrors
yumrepo { 'my-repos':
baseurl => 'http://mirrors.example.com/my-mirrors-release/el6',
enabled => 1,
}
package { 'my-mirrors-release':
provider => yum,
ensure => latest,
require => Yumrepo['my-repos'],
}
# Ensure our repositories are installed before any other package.
# (Otherwise the package may not be found.)
Package<| title == 'my-mirrors-release' |> -> Package<| title != 'my-mirrors-release' |>
}