rke2,puppet: enforce versionlock before package install #514
Reference in New Issue
Block a user
Delete Branch "benvin/versionlock-before-upgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
A package versionlock is only effective if it is applied before the package resource is evaluated. When the package is upgraded/installed first and locked afterwards, dnf can pull an unpinned version and the lock then pins whatever landed. This is the exact drift that let new RKE2 nodes boot 1.33.11 instead of the pinned version, and it also matters because a global
dnf update -yautoupdate timer (profiles::yum::autoupdater) relies on the versionlock plugin already having the lock written.Changes
rke2::installorders the versionlock ahead of the package: addsbefore => Package["rke2-${node_type}"]so the lock exists before install/upgrade.profiles::puppet::agent(RedHat branch) addsbefore => Package[$use_package]on the versionlock for the same reason.profiles::gitea::runnerandprofiles::vault::serverunchanged: both already order the versionlock ahead of the package (before => Package/before => Class['vault']).https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
A versionlock is useless if the package resource is evaluated before the lock is in place: dnf upgrades the package to an unpinned version, then the lock pins whatever landed. This is the drift that let new RKE2 nodes boot 1.33.11 instead of the pinned version. Order the versionlock ahead of the package everywhere the two lacked a relationship: - rke2::install adds before => Package["rke2-${node_type}"] on the versionlock so the lock exists before install/upgrade. - profiles::puppet::agent (RedHat) adds before => Package[$use_package] on the versionlock for the same reason. profiles::gitea::runner and profiles::vault::server already ordered the versionlock ahead of the package (before => Package / before => Class) and are unchanged. Locked versions themselves are untouched. Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT