How to prevent almalinux- repos from reappearing

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 …

But does that
disable the specified repositories: baseos , appstream , and extraswhich we want to keep though just coming from our foreman?

Editing them manually to be disabled sounds like a pain in the butt because of the amount of labour for many many machines.

One could ask why your own repos have same repoid as the Alma’s default repos?

If you can run “rm filename” in many machines, then you can run ‘echo “” > filename’ in those machines too.

Well i havent set them, they were given to me so cant raply on that.

Made a playbook to delete those files. Case closed.

Good. As I said, edit and removal should be equally easy with a play.

Quick and dirty like my women ftw. :laughing: