Do-release-upgrade with a local apt repo

I have Ubuntu 20.04 systems at my workplace, and I want to do an do-relelase-upgrade but it will only use my local apt repo. I’m currently debating on using 22.04 or jumping straight to 24.04.

How would I make sure that it won’t use the official Ubuntu repo and only local apt mirror, including custom repos?

My current plan is to do an Ansible task that will run do-release-upgrade, but I’m looking for a way to make sure it doesn’t use the official repos. I did debate on just changing all instances of “focal” and change it to “jammy” or “noble”, but I have some reservations on that as I’m jumping from one LTS to another.

There is some source code you can read.

In principle the system upgrade should basically be update repos, install new packages, remove obsolete. However in practise I’m not sure if Ubuntu has any special source in there.