@@ -21,6 +21,9 @@ the `os_patching` fact.
2121[ puppet health check] ( https://forge.puppet.com/albatrossflavour/puppet_health_check )
2222module to perform a pre-check on the nodes you're planning to patch. If the nodes pass the
2323check, they get patched
24+ * [ ` os_patching::patch_batch ` ] ( #os_patching--patch_batch ) : Patch nodes in a batch, is called from patch_group plan or patch_pql plan
25+ * [ ` os_patching::patch_group ` ] ( #os_patching--patch_group ) : Patch nodes collected by a fact group
26+ * [ ` os_patching::patch_pql ` ] ( #os_patching--patch_pql ) : Patch nodes collected by a PQL query
2427
2528## Classes
2629
@@ -43,6 +46,7 @@ class { 'os_patching':
4346 'end' => '2019-01-15T23:59:59+10:00',
4447 },
4548 },
49+ group => 'patching01',
4650}
4751```
4852
@@ -65,6 +69,7 @@ class profiles::soe::patching (
6569 patch_window => $patch_window,
6670 reboot_override => $reboot_override,
6771 blackout_windows => $full_blackout_windows,
72+ group => 'patching01',
6873 }
6974}
7075```
@@ -119,6 +124,7 @@ The following parameters are available in the `os_patching` class:
119124* [ ` windows_update_interval_mins ` ] ( #-os_patching--windows_update_interval_mins )
120125* [ ` fact_mode ` ] ( #-os_patching--fact_mode )
121126* [ ` ensure ` ] ( #-os_patching--ensure )
127+ * [ ` group ` ] ( #-os_patching--group )
122128
123129##### <a name =" -os_patching--puppet_binary " ></a >` puppet_binary `
124130
@@ -212,7 +218,7 @@ This overrides the setting in the task
212218
213219##### <a name =" -os_patching--patch_window " ></a >` patch_window `
214220
215- Data type: ` Optional[String ] `
221+ Data type: ` Optional[Pattern[/^[A-Za-z0-9\-_ ]+$/] ] `
216222
217223A freeform text entry used to allocate a node to a specific patch window (Optional)
218224
@@ -296,6 +302,14 @@ Data type: `Enum['present', 'absent']`
296302
297303` present ` to install scripts, cronjobs, files, etc, ` absent ` to cleanup a system that previously hosted us
298304
305+ ##### <a name =" -os_patching--group " ></a >` group `
306+
307+ Data type: ` Optional[Pattern[/^[A-Za-z0-9\-_ ]+$/]] `
308+
309+ The group to assign the node for patching purposes.
310+
311+ Default value: ` undef `
312+
299313## Tasks
300314
301315### <a name =" clean_cache " ></a >` clean_cache `
@@ -399,3 +413,197 @@ Data type: `Optional[Integer]`
399413
400414Default value: ` 1800 `
401415
416+ ### <a name =" os_patching--patch_batch " ></a >` os_patching::patch_batch `
417+
418+ Patch nodes in a batch, is called from patch_group plan or patch_pql plan
419+
420+ #### Parameters
421+
422+ The following parameters are available in the ` os_patching::patch_batch ` plan:
423+
424+ * [ ` batch ` ] ( #-os_patching--patch_batch--batch )
425+ * [ ` catch_errors ` ] ( #-os_patching--patch_batch--catch_errors )
426+ * [ ` noop_state ` ] ( #-os_patching--patch_batch--noop_state )
427+ * [ ` run_health_check ` ] ( #-os_patching--patch_batch--run_health_check )
428+ * [ ` service_enabled ` ] ( #-os_patching--patch_batch--service_enabled )
429+ * [ ` service_running ` ] ( #-os_patching--patch_batch--service_running )
430+ * [ ` runinterval ` ] ( #-os_patching--patch_batch--runinterval )
431+ * [ ` debug ` ] ( #-os_patching--patch_batch--debug )
432+
433+ ##### <a name =" -os_patching--patch_batch--batch " ></a >` batch `
434+
435+ Data type: ` TargetSpec `
436+
437+ The batch of nodes to patch
438+
439+ ##### <a name =" -os_patching--patch_batch--catch_errors " ></a >` catch_errors `
440+
441+ Data type: ` Boolean `
442+
443+ Whether to catch errors during task execution
444+
445+ Default value: ` true `
446+
447+ ##### <a name =" -os_patching--patch_batch--noop_state " ></a >` noop_state `
448+
449+ Data type: ` Boolean `
450+
451+ Whether to consider noop state during health check
452+
453+ Default value: ` false `
454+
455+ ##### <a name =" -os_patching--patch_batch--run_health_check " ></a >` run_health_check `
456+
457+ Data type: ` Boolean `
458+
459+ Whether to run a health check before patching
460+
461+ Default value: ` false `
462+
463+ ##### <a name =" -os_patching--patch_batch--service_enabled " ></a >` service_enabled `
464+
465+ Data type: ` Boolean `
466+
467+ Whether the puppet service should be enabled during health check
468+
469+ Default value: ` true `
470+
471+ ##### <a name =" -os_patching--patch_batch--service_running " ></a >` service_running `
472+
473+ Data type: ` Boolean `
474+
475+ Whether the puppet service should be running during health check
476+
477+ Default value: ` true `
478+
479+ ##### <a name =" -os_patching--patch_batch--runinterval " ></a >` runinterval `
480+
481+ Data type: ` Integer[0] `
482+
483+ The runinterval to use during health check
484+
485+ Default value: ` 1800 `
486+
487+ ##### <a name =" -os_patching--patch_batch--debug " ></a >` debug `
488+
489+ Data type: ` Boolean `
490+
491+ Whether to enable debug output
492+
493+ Default value: ` false `
494+
495+ ### <a name =" os_patching--patch_group " ></a >` os_patching::patch_group `
496+
497+ Patch nodes collected by a fact group
498+
499+ #### Parameters
500+
501+ The following parameters are available in the ` os_patching::patch_group ` plan:
502+
503+ * [ ` group ` ] ( #-os_patching--patch_group--group )
504+ * [ ` patch_in_batches ` ] ( #-os_patching--patch_group--patch_in_batches )
505+ * [ ` batch_size ` ] ( #-os_patching--patch_group--batch_size )
506+ * [ ` run_health_check ` ] ( #-os_patching--patch_group--run_health_check )
507+ * [ ` debug ` ] ( #-os_patching--patch_group--debug )
508+ * [ ` pql_query ` ] ( #-os_patching--patch_group--pql_query )
509+
510+ ##### <a name =" -os_patching--patch_group--group " ></a >` group `
511+
512+ Data type: ` String[1] `
513+
514+ The fact group name to patch
515+
516+ ##### <a name =" -os_patching--patch_group--patch_in_batches " ></a >` patch_in_batches `
517+
518+ Data type: ` Boolean `
519+
520+ Whether to patch nodes in batches
521+
522+ Default value: ` true `
523+
524+ ##### <a name =" -os_patching--patch_group--batch_size " ></a >` batch_size `
525+
526+ Data type: ` Integer[0] `
527+
528+ The size of each batch if patching in batches
529+
530+ Default value: ` 15 `
531+
532+ ##### <a name =" -os_patching--patch_group--run_health_check " ></a >` run_health_check `
533+
534+ Data type: ` Boolean `
535+
536+ Whether to run a health check after patching
537+
538+ Default value: ` true `
539+
540+ ##### <a name =" -os_patching--patch_group--debug " ></a >` debug `
541+
542+ Data type: ` Boolean `
543+
544+ Whether to enable debug output
545+
546+ Default value: ` false `
547+
548+ ##### <a name =" -os_patching--patch_group--pql_query " ></a >` pql_query `
549+
550+ Data type: ` String[1] `
551+
552+ The PQL query to retrieve nodes in the group
553+
554+ Default value: ` "inventory[certname] { facts.os_patching.group = '${group}'}" `
555+
556+ ### <a name =" os_patching--patch_pql " ></a >` os_patching::patch_pql `
557+
558+ Patch nodes collected by a PQL query
559+
560+ #### Parameters
561+
562+ The following parameters are available in the ` os_patching::patch_pql ` plan:
563+
564+ * [ ` pql_query ` ] ( #-os_patching--patch_pql--pql_query )
565+ * [ ` patch_in_batches ` ] ( #-os_patching--patch_pql--patch_in_batches )
566+ * [ ` batch_size ` ] ( #-os_patching--patch_pql--batch_size )
567+ * [ ` run_health_check ` ] ( #-os_patching--patch_pql--run_health_check )
568+ * [ ` debug ` ] ( #-os_patching--patch_pql--debug )
569+
570+ ##### <a name =" -os_patching--patch_pql--pql_query " ></a >` pql_query `
571+
572+ Data type: ` String[1] `
573+
574+ The PQL query to retrieve nodes to patch
575+
576+ Default value: ` 'inventory[certname] { facts.os.family = "redhat" }' `
577+
578+ ##### <a name =" -os_patching--patch_pql--patch_in_batches " ></a >` patch_in_batches `
579+
580+ Data type: ` Boolean `
581+
582+ Whether to patch nodes in batches
583+
584+ Default value: ` true `
585+
586+ ##### <a name =" -os_patching--patch_pql--batch_size " ></a >` batch_size `
587+
588+ Data type: ` Integer[0] `
589+
590+ The size of each batch if patching in batches
591+
592+ Default value: ` 15 `
593+
594+ ##### <a name =" -os_patching--patch_pql--run_health_check " ></a >` run_health_check `
595+
596+ Data type: ` Boolean `
597+
598+ Whether to run a health check after patching
599+
600+ Default value: ` true `
601+
602+ ##### <a name =" -os_patching--patch_pql--debug " ></a >` debug `
603+
604+ Data type: ` Boolean `
605+
606+ Whether to enable debug output
607+
608+ Default value: ` false `
609+
0 commit comments