forked from CERIT-SC/puppet-yum
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix purge of unwanted kernels on DNF based machines
Previously when `installonly_limit` of a node is adjusted then `package-cleanup` was called to remove unwanted old kernels. This is invalid for dnf based systems and a new command must be used. This DNF command will remove kernel packages except in two cases: * It is the running kernel as determined from `$facts['kernelrelease']` * It is one of last N kernel versions where N is the `installonly_limit` Fixes #295
- Loading branch information
1 parent
7e7b8c7
commit 413fbc6
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper_acceptance' | ||
|
||
describe 'yum::config installonly_limit 1' do | ||
context 'simple parameters' do | ||
# Using puppet_apply as a helper | ||
it 'must work idempotently with no errors' do | ||
pp = <<-EOS | ||
yum::config{'installonly_limit': | ||
ensure => 2, # yum (and not dnf) does not like the value 1 | ||
} | ||
include yum | ||
EOS | ||
# Run it twice and test for idempotency | ||
apply_manifest(pp, catch_failures: true) | ||
apply_manifest(pp, catch_changes: true) | ||
end | ||
end | ||
end |
This file contains 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