Skip to content

Commit f5e7c5f

Browse files
authored
Merge pull request #74 from EncoreTechnologies/hotfix/reboot-strategy
Reboot Strategy
2 parents b686418 + 9d63dca commit f5e7c5f

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

CHANGELOG.md

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

55
## Development
66

7+
- Fixed issue where agruments for reboot strategy are being overridden by
8+
inventory file.
9+
10+
Contributed by Bradley Bishop (@bishopbm1)
11+
712
- Switch from Travis to GitHub Actions
813

914
Contributed by Nick Maludy (@nmaludy)
@@ -29,10 +34,10 @@ All notable changes to this project will be documented in this file.
2934
Contributed by Haroon Rafique
3035

3136
* Added new configuration option:
32-
* `patching_update_provider`: Parameter sets the provider in the update tasks.
37+
* `patching_update_provider`: Parameter sets the provider in the update tasks.
3338

3439
Contributed by Bill Sirinek (@sirinek)
35-
40+
3641
* Fixed bug in `patching::available_updates_windows` where if `choco outdated` printed an
3742
error, but returned a `0` exit status our output parsing code was throwing an exception
3843
causing a unhelpful error to be printed. Now, we check for this condition and if we
@@ -73,7 +78,7 @@ All notable changes to this project will be documented in this file.
7378
* Added new configuration options:
7479
* `patching_reboot_wait`: Parameter controls the `reboot_wait` option for the number of seconds
7580
to wait between reboots. Default = 300
76-
* `paching_report_file`: Customize the name of the report file to write to disk. You
81+
* `paching_report_file`: Customize the name of the report file to write to disk. You
7782
can disable writing the report files by specifying this as `'disabled'`.
7883
NOTE: for PE users writing files to disk throws an error, so you'll be happy you can
7984
now disable writing these files!
@@ -82,12 +87,12 @@ All notable changes to this project will be documented in this file.
8287
Default = `pretty`
8388

8489
(Enhancement)
85-
90+
8691
Contributed by Nick Maludy (@nmaludy)
87-
92+
8893
* To support the new configuration options above, the `patching::reboot_required` plan
8994
had its parameter `reboot_wait` renamed to `wait`. (Enhancement)
90-
95+
9196
Contributed by Nick Maludy (@nmaludy)
9297

9398
## Release 1.0.1 (2020-03-04)

metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "encore-patching",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"author": "Encore Technologies",
55
"summary": "Implements OS patching workflows using Bolt tasks and plans.",
66
"license": "Apache-2.0",

plans/reboot_required.pp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,22 @@
4444
#
4545
plan patching::reboot_required (
4646
TargetSpec $targets,
47-
Enum['only_required', 'never', 'always'] $strategy = 'only_required',
48-
String $message = 'NOTICE: This system is currently being updated.',
49-
Integer $wait = 300,
47+
Enum['only_required', 'never', 'always'] $strategy = undef,
48+
String $message = undef,
49+
Integer $wait = undef,
5050
Boolean $noop = false,
5151
) {
5252
$_targets = run_plan('patching::get_targets', $targets)
5353
$group_vars = $_targets[0].vars
54-
$_strategy = pick($group_vars['patching_reboot_strategy'], $strategy)
55-
$_message = pick($group_vars['patching_reboot_message'], $message)
56-
$_wait = pick($group_vars['patching_reboot_wait'], $wait)
54+
$_strategy = pick($strategy,
55+
$group_vars['patching_reboot_strategy'],
56+
'only_required')
57+
$_message = pick($message,
58+
$group_vars['patching_reboot_message'],
59+
'NOTICE: This system is currently being updated.')
60+
$_wait = pick($wait,
61+
$group_vars['patching_reboot_wait'],
62+
300)
5763

5864
## Check if reboot required.
5965
$reboot_results = run_task('patching::reboot_required', $_targets)

0 commit comments

Comments
 (0)