Skip to content

Commit 50a350e

Browse files
authored
Merge pull request #43 from msurato/master
Fix wait parameter
2 parents b4d176f + 84d7144 commit 50a350e

3 files changed

Lines changed: 13 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44

55
## Development
66

7+
* Fixed a bug with a hard coded wait for reboot. (Bug Fix)
8+
9+
Contributed by Michael Surato (@msurato)
710

811
## Release 1.0.1 (2020-03-04)
912

plans/init.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,10 @@
218218

219219
## Check if reboot required and reboot if true.
220220
run_plan('patching::reboot_required', $update_ok_targets,
221-
strategy => $reboot_strategy_group,
222-
message => $reboot_message_group,
223-
noop => $noop)
221+
strategy => $reboot_strategy_group,
222+
message => $reboot_message_group,
223+
reboot_wait => $reboot_wait,
224+
noop => $noop)
224225

225226
## Remove VM snapshots
226227
if $snapshot_delete_group and $snapshot_plan_group and $snapshot_plan_group != 'disabled' {

plans/reboot_required.pp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@
3131
# - `resultset` : results from the `reboot` plan for the attempted hosts (potentially an empty `ResultSet`)
3232
#
3333
plan patching::reboot_required (
34-
TargetSpec $targets,
34+
TargetSpec $targets,
3535
Enum['only_required', 'never', 'always'] $strategy = 'only_required',
36-
String $message = 'NOTICE: This system is currently being updated.',
37-
Boolean $noop = false,
36+
String $message = 'NOTICE: This system is currently being updated.',
37+
Boolean $noop = false,
38+
Optional[Integer] $reboot_wait = 300,
3839
) {
3940
$_targets = run_plan('patching::get_targets', $targets)
4041
$group_vars = $_targets[0].vars
@@ -62,7 +63,7 @@
6263
if !$targets_reboot_required.empty() {
6364
$targets_reboot_attempted = $targets_reboot_required
6465
$reboot_resultset = run_plan('reboot', $targets_reboot_required,
65-
reconnect_timeout => 300,
66+
reconnect_timeout => $reboot_wait,
6667
message => $_message,
6768
_catch_errors => true)
6869
}
@@ -74,7 +75,7 @@
7475
'always': {
7576
$targets_reboot_attempted = $targets
7677
$reboot_resultset = run_plan('reboot', $targets,
77-
reconnect_timeout => 300,
78+
reconnect_timeout => $reboot_wait,
7879
message => $_message,
7980
_catch_errors => true)
8081
}

0 commit comments

Comments
 (0)