fix(roles): refresh apt cache before upgrade on Debian#286
Open
markuslf wants to merge 1 commit into
Open
Conversation
Apply the same fix as 587dc13 (icinga2_agent) to the other roles that upgrade a package to `state: latest` on Debian-family hosts. apt does not auto-expire its cache the way dnf does, so without an explicit refresh the upgrade can run against a stale cache and miss newer versions (e.g. security updates). Affected: php (php:update), mariadb_server (mariadb_server:upgrade), monitoring_plugins.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to 587dc13 (
fix(roles/icinga2_agent): refresh apt cache before upgrade on Debian).That fix addressed the stale-apt-cache problem only in
icinga2_agent. The same pattern (upgrading a package tostate: lateston Debian-family hosts without refreshing the apt cache first) exists in three other roles. apt does not auto-expire its cache the way dnf does, so without an explicitapt updatethe upgrade can resolve against stale metadata and miss newer versions, e.g. security updates.Changes
Add an
apt updatetask (update_cache: true,changed_when: false,when: os_family == "Debian") right before thestate: latesttask in:state: latesttasks under thephp:updatetag (Update php php-fpm composerandUpdate PHP modules).Install latest mariadb-serverunder themariadb_server:upgradetag.install linuxfabrik-monitoring-plugins*in the package install path.RHEL-family hosts are unaffected, since dnf refreshes its metadata on its own.
CHANGELOG updated.