|
109 | 109 | Boolean $noop = false, |
110 | 110 | ) { |
111 | 111 | ## Filter offline targets |
112 | | - $check_puppet_result = run_plan('patching::check_puppet', |
113 | | - targets => $targets, |
| 112 | + $check_puppet_result = run_plan('patching::check_puppet', $targets, |
114 | 113 | filter_offline_targets => $filter_offline_targets) |
115 | 114 | # use all targets, both with and without puppet |
116 | 115 | $_targets = $check_puppet_result['all'] |
117 | 116 |
|
118 | 117 | ## Group all of the targets based on their 'patching_order' var |
119 | | - $ordered_groups = run_plan('patching::ordered_groups', targets => $_targets) |
| 118 | + $ordered_groups = run_plan('patching::ordered_groups', $_targets) |
120 | 119 |
|
121 | 120 | # we can now use the $ordered_keys array above to index into our $ordered_hash |
122 | 121 | # pretty cool huh? |
|
166 | 165 | _noop => $noop) |
167 | 166 |
|
168 | 167 | ## Check for updates on hosts |
169 | | - $available_results = run_plan('patching::available_updates', |
170 | | - targets => $ordered_targets, |
| 168 | + $available_results = run_plan('patching::available_updates', $ordered_targets, |
171 | 169 | format => 'pretty', |
172 | 170 | noop => $noop) |
173 | 171 | $update_targets = $available_results['has_updates'] |
|
177 | 175 |
|
178 | 176 | ## Disable monitoring |
179 | 177 | if $monitoring_enabled_group and $monitoring_plan_group and $monitoring_plan_group != 'disabled' { |
180 | | - run_plan($monitoring_plan_group, |
181 | | - targets => $update_targets, |
182 | | - action => 'disable', |
183 | | - noop => $noop) |
| 178 | + run_plan($monitoring_plan_group, $update_targets, |
| 179 | + action => 'disable', |
| 180 | + noop => $noop) |
184 | 181 | } |
185 | 182 |
|
186 | 183 | ## Create VM snapshots |
187 | 184 | if $snapshot_create_group and $snapshot_plan_group and $snapshot_plan_group != 'disabled'{ |
188 | | - run_plan($snapshot_plan_group, |
189 | | - targets => $update_targets, |
190 | | - action => 'create', |
191 | | - noop => $noop) |
| 185 | + run_plan($snapshot_plan_group, $update_targets, |
| 186 | + action => 'create', |
| 187 | + noop => $noop) |
192 | 188 | } |
193 | 189 |
|
194 | 190 | ## Run pre-patching script. |
195 | | - run_plan($pre_update_plan_group, |
196 | | - targets => $update_targets, |
197 | | - noop => $noop) |
| 191 | + run_plan($pre_update_plan_group, $update_targets, |
| 192 | + noop => $noop) |
198 | 193 |
|
199 | 194 | ## Run package update. |
200 | 195 | $update_result = run_task('patching::update', $update_targets, |
|
218 | 213 |
|
219 | 214 | if !$update_ok_targets.empty { |
220 | 215 | ## Run post-patching script. |
221 | | - run_plan($post_update_plan_group, |
222 | | - targets => $update_ok_targets, |
223 | | - noop => $noop) |
| 216 | + run_plan($post_update_plan_group, $update_ok_targets, |
| 217 | + noop => $noop) |
224 | 218 |
|
225 | 219 | ## Check if reboot required and reboot if true. |
226 | | - run_plan('patching::reboot_required', |
227 | | - targets => $update_ok_targets, |
| 220 | + run_plan('patching::reboot_required', $update_ok_targets, |
228 | 221 | strategy => $reboot_strategy_group, |
229 | 222 | message => $reboot_message_group, |
230 | 223 | noop => $noop) |
231 | 224 |
|
232 | 225 | ## Remove VM snapshots |
233 | 226 | if $snapshot_delete_group and $snapshot_plan_group and $snapshot_plan_group != 'disabled' { |
234 | | - run_plan($snapshot_plan_group, |
235 | | - targets => $update_ok_targets, |
236 | | - action => 'delete', |
237 | | - noop => $noop) |
| 227 | + run_plan($snapshot_plan_group, $update_ok_targets, |
| 228 | + action => 'delete', |
| 229 | + noop => $noop) |
238 | 230 | } |
239 | 231 | } |
240 | 232 | # else { |
|
243 | 235 |
|
244 | 236 | ## enable monitoring |
245 | 237 | if $monitoring_enabled_group and $monitoring_plan_group and $monitoring_plan_group != 'disabled' { |
246 | | - run_plan($monitoring_plan_group, |
247 | | - targets => $update_targets, |
248 | | - action => 'enable', |
249 | | - noop => $noop) |
| 238 | + run_plan($monitoring_plan_group, $update_targets, |
| 239 | + action => 'enable', |
| 240 | + noop => $noop) |
250 | 241 | } |
251 | 242 | } |
252 | 243 |
|
|
261 | 252 | wait_until_available($_targets, wait_time => $reboot_wait) |
262 | 253 |
|
263 | 254 | ## Collect summary report |
264 | | - run_plan('patching::update_history', |
265 | | - targets => $_targets, |
266 | | - format => 'pretty') |
| 255 | + run_plan('patching::update_history', $_targets, |
| 256 | + format => 'pretty') |
267 | 257 |
|
268 | 258 | ## Display final status |
269 | 259 | return() |
|
0 commit comments