diff --git a/CHANGELOG.md b/CHANGELOG.md index e2d8da9..6fc7ed7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file. Contributed by Vadym Chepkov (@vchepkov) +## Release 1.5.0 (2021-06-20) + +* Added disconnect_wait input to be passed to the reboot plan so that + there can be controls around when the plan checks if the server has + rebooted. + + Contributed by Bradley Bishop (@bishopbm1) + ## Release 1.4.0 (2021-04-30) * Added a new plan and task `patching::snapshot_kvm` for creating/deleting diff --git a/metadata.json b/metadata.json index d3efd46..12034c8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "encore-patching", - "version": "1.4.0", + "version": "1.5.0", "author": "Encore Technologies", "summary": "Implements OS patching workflows using Bolt tasks and plans.", "license": "Apache-2.0", diff --git a/plans/init.pp b/plans/init.pp index f2a0e4e..e56761c 100644 --- a/plans/init.pp +++ b/plans/init.pp @@ -60,6 +60,8 @@ # 2. A later group is a linux router. In this instance maybe the patching of the linux router # affects the reachability of previous hosts. # +# @param [Integer] disconnect_wait How long (in seconds) to wait before checking whether the server has rebooted. Defaults to 10. +# # @param [Optional[String]] snapshot_plan # Name of the plan to use for executing snaphot creation and deletion steps of the workflow # You can also pass `'disabled'` or `undef'` as an easy way to disable both creation and deletion. @@ -120,6 +122,7 @@ Optional[Enum['only_required', 'never', 'always']] $reboot_strategy = undef, Optional[String] $reboot_message = undef, Optional[Integer] $reboot_wait = undef, + Optional[Integer] $disconnect_wait = undef, Optional[String] $snapshot_plan = undef, Optional[Boolean] $snapshot_create = undef, Optional[Boolean] $snapshot_delete = undef, @@ -194,6 +197,9 @@ $snapshot_delete_group = pick($snapshot_delete, $group_vars['patching_snapshot_delete'], true) + $disconnect_wait_group = pick($disconnect_wait, + $group_vars['patching_disconnect_wait'], + 10) # do normal patching @@ -257,10 +263,11 @@ ## Check if reboot required and reboot if true. run_plan('patching::reboot_required', $update_ok_targets, - strategy => $reboot_strategy_group, - message => $reboot_message_group, - wait => $reboot_wait_group, - noop => $noop) + strategy => $reboot_strategy_group, + message => $reboot_message_group, + wait => $reboot_wait_group, + disconnect_wait => $disconnect_wait_group, + noop => $noop) ## Remove VM snapshots if $snapshot_delete_group and $snapshot_plan_group and $snapshot_plan_group != 'disabled' { diff --git a/plans/reboot_required.pp b/plans/reboot_required.pp index f60c599..aa0e37c 100644 --- a/plans/reboot_required.pp +++ b/plans/reboot_required.pp @@ -30,6 +30,8 @@ # 2. A later group is a linux router. In this instance maybe the patching of the linux router # affects the reachability of previous hosts. # +# @param [Integer] disconnect_wait How long (in seconds) to wait before checking whether the server has rebooted. Defaults to 10. +# # @param [Boolean] noop # Flag to determine if this should be a noop operation or not. # If this is a noop, no hosts will ever be rebooted, however the "reboot required" information @@ -47,6 +49,7 @@ Enum['only_required', 'never', 'always'] $strategy = undef, String $message = undef, Integer $wait = undef, + Integer $disconnect_wait = undef, Boolean $noop = false, ) { $_targets = run_plan('patching::get_targets', $targets) @@ -60,6 +63,9 @@ $_wait = pick($wait, $group_vars['patching_reboot_wait'], 300) + $_disconnect_wait = pick($disconnect_wait, + $group_vars['patching_disconnect_wait'], + 10) ## Check if reboot required. $reboot_results = run_task('patching::reboot_required', $_targets) @@ -83,6 +89,7 @@ $targets_reboot_attempted = $targets_reboot_required $reboot_resultset = run_plan('reboot', $targets_reboot_required, reconnect_timeout => $_wait, + disconnect_wait => $_disconnect_wait, message => $_message, _catch_errors => true) } @@ -95,6 +102,7 @@ $targets_reboot_attempted = $targets $reboot_resultset = run_plan('reboot', $targets, reconnect_timeout => $_wait, + disconnect_wait => $_disconnect_wait, message => $_message, _catch_errors => true) }