Page MenuHomePhabricator

Puppet should support VERSION_CODENAME to detect a distro
Closed, DeclinedPublic

Description

Puppet parses /etc/debian_version (which e.g. contains "11.5" on an up-to-date Bullseye system). Through the lifetime in which a Debian release is "testing" it reads e.g. "bookworm/sid" (and that gets changed only late in the freeze process, e.g. for Bullseye it happened four months before the eventual release).

This makes using testing with systems like Puppet tricky, which was also reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008735

And since base-files 12.3 there is now a new attribute being maintained for this purpose:

Add VERSION_CODENAME to /etc/os-release. Closes: #1008735. This still respects the fact that Debian distributions do not have a version number until they are actually released as stable, but makes /etc/os-release a little bit more useful for those who use testing as a pre-release for the next stable. Those users are also the reason why in this case we are simply using the string "bookworm".

This is exactly what we need, but since the change is very fresh (12.3 was uploaded less than four weeks ago), Puppet should probably follow a mixed scheme: If no specific version is found in /etc/debian_release there should probably be a lookup in /etc/os-release and if that contains VERSION_CODENAME this should map known distro names as a fallback:

bookworm -> 12.0
trixie -> 13.0

We should best work towards getting that changed upstream.

Event Timeline

Change 850498 had a related patch set uploaded (by Jbond; author: jbond):

[operations/puppet@production] C:ldap::client::utils: migrate to debian::codename function

https://gerrit.wikimedia.org/r/850498

Change 850499 had a related patch set uploaded (by Jbond; author: jbond):

[operations/puppet@production] C:debian: add support for testing

https://gerrit.wikimedia.org/r/850499

Change 850498 merged by Jbond:

[operations/puppet@production] C:ldap::client::utils: migrate to debian::codename function

https://gerrit.wikimedia.org/r/850498

Change 850499 merged by Jbond:

[operations/puppet@production] C:debian: add support for testing

https://gerrit.wikimedia.org/r/850499

John's patches linked to the task work great and updating to a "new" testing is now practically no effort, so we've decided to not push for a resolution/support upstream.