From 188e3ae0eab6d3f6ff3d7ff6e1ab6f681edb6e77 Mon Sep 17 00:00:00 2001 From: pccibot <12855858+pccibot@users.noreply.github.com> Date: Fri, 6 Mar 2026 09:56:00 +0000 Subject: [PATCH 1/3] modulesync 10.6.0 --- .devcontainer/devcontainer.json | 1 - .msync.yml | 2 +- Gemfile | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 168a5cb..08c6abf 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,3 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the { "name": "VoxBox", "image": "ghcr.io/voxpupuli/voxbox:latest" diff --git a/.msync.yml b/.msync.yml index 179bafc..7d6d4ee 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '10.5.0' +modulesync_config_version: '10.6.0' diff --git a/Gemfile b/Gemfile index 5f69bec..e0c8581 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem 'voxpupuli-test', '~> 13.0', :require => false + gem 'voxpupuli-test', '~> 14.0', :require => false gem 'puppet_metadata', '~> 6.0', :require => false end @@ -18,7 +18,7 @@ group :system_tests do end group :release do - gem 'voxpupuli-release', '~> 5.0', :require => false + gem 'voxpupuli-release', '~> 5.3', :require => false end gem 'rake', :require => false From 22e8750c14f04dcdaea70135aab11d6689e9b9d9 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 6 Mar 2026 13:06:10 +0100 Subject: [PATCH 2/3] rubocop: autocorrect --- .rubocop_todo.yml | 77 ++++++++++++-------------------- spec/classes/os_patching_spec.rb | 2 +- tasks/patch_server.rb | 4 +- 3 files changed, 32 insertions(+), 51 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d221703..abf0436 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by -# `rubocop --auto-gen-config` -# on 2025-10-09 09:45:58 UTC using RuboCop version 1.50.2. +# `rubocop --auto-gen-config --no-auto-gen-timestamp` +# using RuboCop version 1.85.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -63,7 +63,7 @@ Layout/SpaceInsideHashLiteralBraces: - 'spec/classes/os_patching_spec.rb' # Offense count: 7 -# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch. Lint/DuplicateBranch: Exclude: - 'lib/facter/os_patching.rb' @@ -89,8 +89,8 @@ Lint/SymbolConversion: Exclude: - 'spec/classes/os_patching_spec.rb' -# Offense count: 4 -# Configuration parameters: CountBlocks. +# Offense count: 3 +# Configuration parameters: CountBlocks, CountModifierForms. Metrics/BlockNesting: Max: 5 @@ -114,11 +114,9 @@ RSpec/EmptyLineAfterFinalLet: - 'spec/classes/os_patching_spec.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: . -# SupportedStyles: implicit, each, example -RSpec/HookArgument: - EnforcedStyle: each +RSpec/LeakyLocalVariable: + Exclude: + - 'spec/acceptance/os_patching_spec.rb' # Offense count: 1 RSpec/MultipleDescribes: @@ -159,7 +157,7 @@ Style/ConditionalAssignment: # Offense count: 4 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedVars. +# Configuration parameters: AllowedVars, DefaultToNil. Style/FetchEnvVar: Exclude: - 'tasks/patch_server.rb' @@ -171,6 +169,11 @@ Style/FileEmpty: Exclude: - 'lib/facter/os_patching.rb' +# Offense count: 13 +Style/FileOpen: + Exclude: + - 'lib/facter/os_patching.rb' + # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). Style/FileRead: @@ -183,6 +186,7 @@ Style/FileRead: # SupportedStyles: always, always_true, never Style/FrozenStringLiteralComment: Exclude: + - '**/*.arb' - 'lib/facter/os_patching.rb' - 'spec/acceptance/os_patching_spec.rb' - 'spec/classes/os_patching_spec.rb' @@ -196,11 +200,11 @@ Style/GlobalStdStream: Exclude: - 'tasks/patch_server.rb' -# Offense count: 42 +# Offense count: 43 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys -# SupportedShorthandSyntax: always, never, either, consistent +# SupportedShorthandSyntax: always, never, either, consistent, either_consistent Style/HashSyntax: Exclude: - 'lib/facter/os_patching.rb' @@ -208,7 +212,7 @@ Style/HashSyntax: - 'tasks/patch_server.rb' - 'tasks/refresh_fact.rb' -# Offense count: 11 +# Offense count: 12 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: Exclude: @@ -216,19 +220,20 @@ Style/IfUnlessModifier: - 'tasks/clean_cache.rb' - 'tasks/patch_server.rb' -# Offense count: 4 +# Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods. -# AllowedMethods: nonzero? +# AllowedMethods: infinite?, nonzero? Style/IfWithBooleanLiteralBranches: Exclude: - 'lib/facter/os_patching.rb' - 'tasks/patch_server.rb' # Offense count: 1 -Style/MixinUsage: +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/MapIntoArray: Exclude: - - 'spec/spec_helper.rb' + - 'tasks/patch_server.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). @@ -236,17 +241,10 @@ Style/NegatedIfElseCondition: Exclude: - 'tasks/patch_server.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. -# SupportedStyles: predicate, comparison -Style/NumericPredicate: - Exclude: - - 'spec/**/*' - - 'tasks/patch_server.rb' - -# Offense count: 4 +# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowedMethods. +# AllowedMethods: infinite?, nonzero? Style/RedundantCondition: Exclude: - 'tasks/patch_server.rb' @@ -270,7 +268,7 @@ Style/RedundantStringEscape: Exclude: - 'tasks/patch_server.rb' -# Offense count: 34 +# Offense count: 35 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed @@ -283,14 +281,6 @@ Style/RegexpLiteral: - 'tasks/patch_server.rb' - 'tasks/refresh_fact.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, explicit -Style/RescueStandardError: - Exclude: - - 'spec/spec_helper.rb' - # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. @@ -299,7 +289,7 @@ Style/SafeNavigation: Exclude: - 'tasks/patch_server.rb' -# Offense count: 52 +# Offense count: 53 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: @@ -309,16 +299,7 @@ Style/StringConcatenation: - 'spec/classes/os_patching_spec.rb' - 'tasks/patch_server.rb' -# Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArguments: - Exclude: - - 'spec/classes/os_patching_spec.rb' - - 'tasks/patch_server.rb' - -# Offense count: 3 +# Offense count: 4 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinSize, WordRegex. # SupportedStyles: percent, brackets diff --git a/spec/classes/os_patching_spec.rb b/spec/classes/os_patching_spec.rb index b86227d..62f9d5c 100644 --- a/spec/classes/os_patching_spec.rb +++ b/spec/classes/os_patching_spec.rb @@ -170,7 +170,7 @@ context 'with blackout window set' do let(:params) { { - 'blackout_windows' => { 'End of year change freeze': { 'start': '2018-12-15T00:00:00+10:00', 'end': '2019-01-15T23:59:59+10:00' } } + 'blackout_windows' => { 'End of year change freeze': { 'start': '2018-12-15T00:00:00+10:00', 'end': '2019-01-15T23:59:59+10:00' } }, } } it { is_expected.to contain_file(cache_dir + '/blackout_windows').with({ diff --git a/tasks/patch_server.rb b/tasks/patch_server.rb index 45d4c9c..e5e2d52 100755 --- a/tasks/patch_server.rb +++ b/tasks/patch_server.rb @@ -171,7 +171,7 @@ def output(returncode, reboot, security, message, packages_updated, debug, job_i :pinned_packages => pinned_packages, :start_time => starttime, :end_time => endtime, - :duration => Time.parse(endtime) - Time.parse(starttime) + :duration => Time.parse(endtime) - Time.parse(starttime), } json[:reboot_required] = pending_reboot_win if IS_WINDOWS @@ -309,7 +309,7 @@ def gather_facts(log, starttime) end # Check we are on a supported platform -unless os['family'] == 'RedHat' || os['family'] == 'Debian' || os['family'] == 'Suse' || os['family'] == 'windows' +unless ['RedHat', 'Debian', 'Suse', 'windows'].include?(os['family']) err(200, 'os_patching/unsupported_os', 'Unsupported OS', starttime) end From 24fdcd6ce949e3ac2ec2f1d1780214e0a36262aa Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 6 Mar 2026 13:35:56 +0100 Subject: [PATCH 3/3] regenerate REFERENCE.md --- REFERENCE.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index a7d11ec..632c1c8 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -139,18 +139,24 @@ Data type: `String` User name for the owner of the patch data +Default value: `'root'` + ##### `patch_data_group` Data type: `String` Group name for the owner of the patch data +Default value: `'root'` + ##### `patch_cron_user` Data type: `String` User who runs the cron job +Default value: `'root'` + ##### `manage_yum_utils` Data type: `Boolean` @@ -158,6 +164,8 @@ Data type: `Boolean` Should the yum_utils/dnf_utils package be managed by this module on RedHat family nodes? If `true`, use the parameter `yum_utils` to determine how it should be manged +Default value: `false` + ##### `block_patching_on_warnings` Data type: `Boolean` @@ -166,24 +174,32 @@ If there are warnings present in the os_patching fact, should the patching task If `true` the run will abort and take no action If `false` the run will continue and attempt to patch (default) +Default value: `false` + ##### `yum_utils` Data type: `Enum['installed', 'absent', 'purged', 'held', 'latest']` If managed, what should the yum_utils package set to? +Default value: `'installed'` + ##### `fact_upload` Data type: `Boolean` Should `puppet fact upload` be run after any changes to the fact cache files? +Default value: `true` + ##### `autoremove` Data type: `Boolean` Should autoremove via the package manager be run after reboot? Only supported on Debian and RedHat family nodes. +Default value: `false` + ##### `manage_delta_rpm` Data type: `Boolean` @@ -191,12 +207,16 @@ Data type: `Boolean` Should the deltarpm package be managed by this module on RedHat family nodes? If `true`, use the parameter `delta_rpm` to determine how it should be manged +Default value: `false` + ##### `delta_rpm` Data type: `Enum['installed', 'absent', 'purged', 'held', 'latest']` If managed, what should the delta_rpm package set to? +Default value: `'installed'` + ##### `manage_yum_plugin_security` Data type: `Boolean` @@ -204,12 +224,16 @@ Data type: `Boolean` Should the yum_plugin_security package be managed by this module on RedHat family nodes? If `true`, use the parameter `yum_plugin_security` to determine how it should be manged +Default value: `false` + ##### `yum_plugin_security` Data type: `Enum['installed', 'absent', 'purged', 'held', 'latest']` If managed, what should the yum_plugin_security package set to? +Default value: `'installed'` + ##### `reboot_override` Data type: `Optional[Variant[Boolean, Enum['always', 'never', 'patched', 'smart', 'default']]]` @@ -217,6 +241,8 @@ Data type: `Optional[Variant[Boolean, Enum['always', 'never', 'patched', 'smart' Controls on a node level if a reboot should/should not be done after patching. This overrides the setting in the task +Default value: `'default'` + ##### `patch_window` Data type: `Optional[Pattern[/^[A-Za-z0-9\-_ ]+$/]]` @@ -247,30 +273,40 @@ The full path of the command to run prior to running patching. Can be used to run customised workflows such as gracefully shutting down applications. The entry must be a single absolute filename with no arguments or parameters. +Default value: `undef` + ##### `patch_cron_hour` Data type: `Variant[Enum['absent'], Integer[0,23]]` The hour(s) for the cron job to run (defaults to absent, which means '*' in cron) +Default value: `'absent'` + ##### `patch_cron_month` Data type: `Variant[Enum['absent'], Integer[1,12]]` The month(s) for the cron job to run (defaults to absent, which means '*' in cron) +Default value: `'absent'` + ##### `patch_cron_monthday` Data type: `Variant[Enum['absent'], Integer[1,31]]` The monthday(s) for the cron job to run (defaults to absent, which means '*' in cron) +Default value: `'absent'` + ##### `patch_cron_weekday` Data type: `Variant[Enum['absent'], Integer[0,7]]` The weekday(s) for the cron job to run (defaults to absent, which means '*' in cron) +Default value: `'absent'` + ##### `patch_cron_min` Data type: `Integer[0,59]` @@ -285,24 +321,32 @@ Data type: `Integer[0,23]` Control the hour on which windows nodes check for updates +Default value: `1` + ##### `windows_update_interval_mins` Data type: `Integer` Control how often windows updates for updates +Default value: `720` + ##### `fact_mode` Data type: `Stdlib::Filemode` Mode to set on fact command file +Default value: `'0700'` + ##### `ensure` Data type: `Enum['present', 'absent']` `present` to install scripts, cronjobs, files, etc, `absent` to cleanup a system that previously hosted us +Default value: `'present'` + ##### `group` Data type: `Optional[Pattern[/^[A-Za-z0-9\-_ ]+$/]]` @@ -317,6 +361,8 @@ Data type: `Integer` The number of seconds to wait after boot before running autoremove +Default value: `300` + ## Tasks ### `clean_cache`