How to download latest version of MK programatically

For our Linux infrastucture running CentOS 7 and Alma Linux 8, we use Foreman/Katello to manage our packages for all Linux servers.
I have created a local repository that I maintain with all CheckMK packages, I will then manually download the RPM from Tribe29 and upload it to our CheckMK repo in Katello, then all servers have access to it via normal installation method. We run Managed Enterprice Edition and use the bakery to update our agents. But the CheckMK servers are updated using scripts as well.

Works really well.