Skip to content

Commit 5bc9bc3

Browse files
committed
Found another wait
Found another spot where the reboot wait is used. This will allow for control of the wait time for the initial reboot as well.
1 parent a2b75bf commit 5bc9bc3

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

plans/init.pp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,11 @@
224224

225225
## Check if reboot required and reboot if true.
226226
run_plan('patching::reboot_required',
227-
nodes => $update_ok_targets,
228-
strategy => $reboot_strategy_group,
229-
message => $reboot_message_group,
230-
noop => $noop)
227+
nodes => $update_ok_targets,
228+
strategy => $reboot_strategy_group,
229+
message => $reboot_message_group,
230+
reboot_wait => $reboot_wait,
231+
noop => $noop)
231232

232233
## Remove VM snapshots
233234
if $snapshot_delete_group and $snapshot_plan_group and $snapshot_plan_group != 'disabled' {

plans/reboot_required.pp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @summary Querys a nodes operating system to determine if a reboot is required and then reboots the nodes that require rebooting.
1+
:was# @summary Querys a nodes operating system to determine if a reboot is required and then reboots the nodes that require rebooting.
22
#
33
# Patching in different environments comes with various unique requirements, one of those
44
# is rebooting hosts. Sometimes hosts need to always be reboot, othertimes never rebooted.
@@ -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 $nodes,
34+
TargetSpec $nodes,
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', nodes => $nodes)
4041
$group_vars = $targets[0].vars
@@ -63,7 +64,7 @@
6364
$nodes_reboot_attempted = $nodes_reboot_required
6465
$reboot_resultset = run_plan('reboot',
6566
nodes => $nodes_reboot_required,
66-
reconnect_timeout => 300,
67+
reconnect_timeout => $reboot_wait,
6768
message => $_message,
6869
_catch_errors => true)
6970
}
@@ -76,7 +77,7 @@
7677
$nodes_reboot_attempted = $targets
7778
$reboot_resultset = run_plan('reboot',
7879
nodes => $nodes,
79-
reconnect_timeout => 300,
80+
reconnect_timeout => $reboot_wait,
8081
message => $_message,
8182
_catch_errors => true)
8283
}

0 commit comments

Comments
 (0)