Hello,
We use foreman to provide updates to almalinux 9’s we use. Looks like every time we get version upgrade from 9.3 to 9.4 like last week we get all of these repos
-rw-r–r–. 1 root root 1023 May 1 23:51 almalinux-appstream.repo
-rw-r–r–. 1 root root 987 May 1 23:51 almalinux-baseos.repo
-rw-r–r–. 1 root root 951 May 1 23:51 almalinux-crb.repo
-rw-r–r–. 1 root root 987 May 1 23:51 almalinux-extras.repo
-rw-r–r–. 1 root root 1107 May 1 23:51 almalinux-highavailability.repo
-rw-r–r–. 1 root root 951 May 1 23:51 almalinux-nfv.repo
-rw-r–r–. 1 root root 963 May 1 23:51 almalinux-plus.repo
-rw-r–r–. 1 root root 1107 May 1 23:51 almalinux-resilientstorage.repo
-rw-r–r–. 1 root root 939 May 1 23:51 almalinux-rt.repo
-rw-r–r–. 1 root root 999 May 1 23:51 almalinux-saphana.repo
-rw-r–r–. 1 root root 951 May 1 23:51 almalinux-sap.repo
-rw-r–r–. 1 root root 5627 Jan 29 12:21 redhat.repo
reappear and we need to do
rm -vf /etc/yum.repos.d/almalinux-* to get rid of them since our repos are in redhat.repo file.
Would there be a way to prevent this from happening or should i just adjust my patching playbook to delete them if there are any.
Do not remove the files. Rather dnf config-manager --disable baseos appstream extras
That edits files to have ‘enabled=0’ on those named repo definitions. Dnf up does not replace edited configuration files; it adds the new version as ‘*.rpmnew’.
Well, you could make the files empty if that foreman misuses disabled repos. If it also gets confused with the *.repo.rpmnew files, then you have to clean those out …
I know this has long been ‘closed’ but there’s a fairly easy and built-in solution with foreman.
Set the parameter: ‘only_subscription_manager_repos’ (boolean) ‘true’ in your hostgroup’s parameters. This will disable all repos not part of the ‘redhat.repo’ file.