|
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. |
2 | 2 | # |
3 | 3 | # Patching in different environments comes with various unique requirements, one of those |
4 | 4 | # is rebooting hosts. Sometimes hosts need to always be reboot, othertimes never rebooted. |
|
31 | 31 | # - `resultset` : results from the `reboot` plan for the attempted hosts (potentially an empty `ResultSet`) |
32 | 32 | # |
33 | 33 | plan patching::reboot_required ( |
34 | | - TargetSpec $nodes, |
| 34 | + TargetSpec $nodes, |
35 | 35 | 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, |
38 | 39 | ) { |
39 | 40 | $targets = run_plan('patching::get_targets', nodes => $nodes) |
40 | 41 | $group_vars = $targets[0].vars |
|
63 | 64 | $nodes_reboot_attempted = $nodes_reboot_required |
64 | 65 | $reboot_resultset = run_plan('reboot', |
65 | 66 | nodes => $nodes_reboot_required, |
66 | | - reconnect_timeout => 300, |
| 67 | + reconnect_timeout => $reboot_wait, |
67 | 68 | message => $_message, |
68 | 69 | _catch_errors => true) |
69 | 70 | } |
|
76 | 77 | $nodes_reboot_attempted = $targets |
77 | 78 | $reboot_resultset = run_plan('reboot', |
78 | 79 | nodes => $nodes, |
79 | | - reconnect_timeout => 300, |
| 80 | + reconnect_timeout => $reboot_wait, |
80 | 81 | message => $_message, |
81 | 82 | _catch_errors => true) |
82 | 83 | } |
|
0 commit comments