cloud-init
cloud-init copied to clipboard
config: Support APT automated mirror selection
Proposed Commit Message
config: Support APT automated mirror selection
The automated mirror selection supported by APT for some time now allows
to separate most info in sources.list from the mirror URL itself. A new
config option asks cloud-init to write one mirror file for primary and
one for security mirror.
To write just the mirrors lists, cloud-init does not longer need to know
about the dists to enable/disable and what the release is to begin with.
On Debian those information is not readily available in all cases.
Additional Context
This will be used in addition https://salsa.debian.org/cloud-team/debian-cloud-images/-/merge_requests/279 to allow mirror selection by cloud-init
Test Steps
Checklist:
- [ ] My code follows the process laid out in the documentation
- [ ] I have updated or added any unit tests accordingly
- [ ] I have updated or added any documentation accordingly
@waldiTM , thanks for the PR. Can you provide some examples of how you think this would be used and how the functionality works? I'm having a hard time finding any kind of documentation for this feature in apt.
Additionally, before we can accept your change, you need to sign the CLA and add your Github username (alphabetically) to the cla signers file . The full details are described in the documentation
The documentation is in apt-transport-mirror(1)
.
We want this for Debian, with the following setup for now:
$ cat /etc/apt/sources.list.d/debian.sources
Types: deb deb-src
URIs: mirror+file:///etc/apt/mirrors/debian.list
Suites: bookworm bookworm-updates bookworm-backports
Components: main
Types: deb deb-src
URIs: mirror+file:///etc/apt/mirrors/debian-security.list
Suites: bookworm-security
Components: main
$ cat /etc/apt/mirrors/debian.list
http://debian-archive.trafficmanager.net/debian
$ cat /etc/apt/mirrors/debian-security.list
http://debian-archive.trafficmanager.net/debian-security
The main advantage is, you can just update the mirrors files, without rewriting the whole sources.list (which requires the distribution name, which is not really available at this step in a Debian system).
For later we intend to also add the fallback mirror, but apt
currently jokes on non-available mirrors a bit (#1017899). This would be then something like:
http://debian-archive.trafficmanager.net/debian prio:1
http://deb.debian.org/debian
Does this make it more clear?
I did the changes and added more details to the schema description.
For the CLA, that is being worked on by my employer. For now I'll add this that way to the package in Debian, as we need it there now.
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close.
If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon.
(If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.)
@waldiTM , any updates on the CLA?
Hello! Thank you for this proposed change to cloud-init. This pull request is now marked as stale as it has not seen any activity in 14 days. If no activity occurs within the next 7 days, this pull request will automatically close.
If you are waiting for code review and you are seeing this message, apologies! Please reply, tagging TheRealFalcon, and he will ensure that someone takes a look soon.
(If the pull request is closed and you would like to continue working on it, please do tag TheRealFalcon to reopen it.)
@waldiTM , we should be able to re-open this at any time. Please do ping if/when you're able to sign the CLA.