patching
: allows global customization of the patching resourcespatching::params
: params for the patching module resources
patching::script
: manages a script for custom patching actions
patching::snapshot_vmware
: Creates/deletes snapshots on VMs using the VMware vSphere API.patching::target_names
: Returns an array of names, one for each target, based on the $name_property
available_updates
: Collects information about available updates on a target systemavailable_updates_linux
: Collects information about available updates on a target systemavailable_updates_windows
: Collects information about available updates on a target systemcache_remove
: Removes/clears the target's update cache. For RHEL/CentOS this means ayum clean all
. For Debian this means aapt update
. For Windows thicache_remove_linux
: Removes/clears the target's update cache. For RHEL/CentOS this means ayum clean all
. For Debian this means aapt update
. For Windows thicache_remove_windows
: Removes/clears the target's update cache. For RHEL/CentOS this means ayum clean all
. For Debian this means aapt update
. For Windows thicache_update
: Updates the targets update cache. For RHEL/CentOS this means ayum clean expire-cache
. For Debian this means aapt update
. For Windows thcache_update_linux
: Updates the targets update cache. For RHEL/CentOS this means ayum clean expire-cache
. For Debian this means aapt update
.cache_update_windows
: Updates the targets update cache. For Windows this means a Windows Update refresh.history
: Reads the update history from the JSON 'result_file'.monitoring_prometheus
: Create or remove alert silences for hosts in Prometheus.monitoring_solarwinds
: Enable or disable monitoring alerts on hosts in SolarWinds.post_update
: Run post-update script on target host(s), only if it exists. If the script doesn't exist or isn't executable, then this task succeeds (this apre_post_update_linux
: Pre-post-update definition to make bolt not throw a warning. Best to use pre_update or post_update directly.pre_post_update_windows
: Pre-post-update definition to make bolt not throw a warning. Best to use pre_update or post_update directly.pre_update
: Run pre-update script on target host(s), only if it exists. If the script doesn't exist or isn't executable, then this task succeeds (this alpuppet_facts
: Gather system facts using 'puppet facts'. Puppet agent MUST be installed for this to work.reboot_required
: Checks if a reboot is pendingreboot_required_linux
: Checks if a reboot is pendingreboot_required_windows
: Checks if a reboot is pendingsnapshot_kvm
: Creates or deletes snapshots on a set of KVM/Libvirt hypervisorsupdate
: Execute OS updates on the target. For RedHat/CentOS this runsyum update
. For Debian/Ubuntu runsapt upgrade
. For Windows this runs Windoupdate_history
: Reads the update history from the JSON 'result_file'.update_history_linux
: Reads the update history from the JSON 'result_file'.update_history_windows
: Reads the update history from the JSON 'result_file'.update_linux
: Execute OS updates on the target. For RedHat/CentOS this runsyum update
. For Debian/Ubuntu runsapt upgrade
. For SLES this runs `zypperupdate_windows
: Execute OS updates on the target. For RedHat/CentOS this runsyum update
. For Debian/Ubuntu runsapt upgrade
. For Windows this runs Windo
patching
: Our generic and semi-opinionated workflow.patching::available_updates
: Checks all targets for available updates reported by their Operating System.patching::check_online
: Checks each node to see they're online.patching::check_puppet
: Checks each node to see if Puppet is installed, then gather Facts on all targets.patching::deploy_scripts
patching::get_facts
: Sets patching facts on targetspatching::get_targets
:get_targets()
except it also performs online checks and gathers facts in one step.patching::monitoring_multiple
: Disable monitoring for targets in multiple servicespatching::monitoring_prometheus
: Create or remove alert silences for hosts in Prometheus.patching::monitoring_solarwinds
: Enable or disable monitoring alerts on hosts in SolarWinds.patching::ordered_groups
: Takes a set of targets then groups and sorts them by thepatching_order
var set on the target.patching::post_update
: Executes a custom post-update script on each node.patching::pre_post_update
: Common entry point for executing the pre/post update custom scriptspatching::pre_update
: Executes a custom pre-update script on each node.patching::puppet_facts
: Plan thatr runs 'puppet facts' on the targets and sets them as facts on the Target objects.patching::reboot_required
: Querys a targets operating system to determine if a reboot is required and then reboots the targets that require rebooting.patching::set_facts
: Sets patching facts on targetspatching::snapshot_kvm
: Creates or deletes VM snapshots on targets in KVM/Libvirt.patching::snapshot_vmware
: Creates or deletes VM snapshots on targets in VMware.patching::update_history
: Collect update history from the results JSON file on the targets
allows global customization of the patching resources
include patching
class {'patching':
bin_dir => '/my/custom/patching/scripts',
}
class {'patching':
owner => 'svc_patching',
group => 'svc_patching',
mode => '0700',
}
patching::bin_dir: '/my/custom/app/patching/dir'
patching::owner: 'svc_patching'
patching::group: 'svc_patching'
patching::mode: '0700'
patching::scripts:
custom_app_pre_patch.sh:
source: 'puppet:///mymodule/patching/custom_app_pre_patch.sh'
custom_app_post_patch.sh:
source: 'puppet:///mymodule/patching/custom_app_post_patch.sh'
The following parameters are available in the patching
class:
Data type: Any
Global directory as the base for bin_dir
and log_dir
Default value: $patching::params::patching_dir
Data type: Any
Global directory where the scripts will be installed
Default value: $patching::params::bin_dir
Data type: Any
Directory where log files will be written during patching
Default value: $patching::params::log_dir
Data type: Any
Default owner of installed scripts
Default value: $patching::params::owner
Data type: Any
Default group of installed scripts
Default value: $patching::params::group
Data type: Any
Default file mode of installed scripts
Default value: $patching::params::mode
Data type: Optional[Hash]
Hash of script resources to instantiate. Useful for declaring script installs from hiera.
Default value: undef
params for the patching module resources
manages a script for custom patching actions
include patching
patching::script { 'pre_patch.sh':
source => 'puppet://mymodule/patching/custom_app_pre_patch.sh',
}
include patching
patching::script { 'pre_patch.sh':
content => template('mymodule/patching/custom_app_pre_patch.sh'),
}
include patching
patching::script { 'custom_app_pre_patch.sh':
content => template('mymodule/patching/custom_app_pre_patch.sh'),
bin_dir => '/my/custom/app/patching/dir',
}
class {'patching':
bin_dir => '/my/custom/app/patching/dir',
}
# we don't have to override bin_dir on each of these because
# we configured it gobally in the patching class above
patching::script { 'custom_app_pre_patch.sh':
content => template('mymodule/patching/custom_app_pre_patch.sh'),
}
patching::script { 'custom_app_post_patch.sh':
content => template('mymodule/patching/custom_app_post_patch.sh'),
}
patching::bin_dir: '/my/custom/app/patching/dir'
patching::scripts:
custom_app_pre_patch.sh:
source: 'puppet:///mymodule/patching/custom_app_pre_patch.sh'
custom_app_post_patch.sh:
source: 'puppet:///mymodule/patching/custom_app_post_patch.sh'
The following parameters are available in the patching::script
defined type:
Data type: Any
Source (puppet path) for the file
resource of the script.
Either source
our content
must be specified. If neither are specified an error will be thrown.
Default value: undef
Data type: Any
Content (raw string, result of template()
, etc) for the file
resource of the script.
Either source
our content
must be specified. If neither are specified an error will be thrown.
Default value: undef
Data type: Any
Directory where the script will be installed
Default value: $patching::bin_dir
Data type: Any
Owner of the script file
Default value: $patching::owner
Data type: Any
Group of the script file
Default value: $patching::group
Data type: Any
File mode to set on the script
Default value: $patching::mode
Type: Ruby 4.x API
Creates/deletes snapshots on VMs using the VMware vSphere API.
patching::snapshot_vmware(Array $vm_names, String $snapshot_name, String $vsphere_host, String $vsphere_username, String $vsphere_password, String $vsphere_datacenter, Optional[Boolean] $vsphere_insecure, Optional[String] $snapshot_description, Optional[Boolean] $snapshot_memory, Optional[Boolean] $snapshot_quiesce, Optional[String] $action)
Creates/deletes snapshots on VMs using the VMware vSphere API.
Returns: Array
Results from the snapshot create/delete tasks
Data type: Array
Array of VM names to create/delete snapshots on
Data type: String
Name of the snapshot to create/delete
Data type: String
Hostname/IP of the vSphere server
Data type: String
Username to use for authenticating to vSphere
Data type: String
Password to use for authenticating to vSphere
Data type: String
Datacenter in the vSphere to use when search for VMs
Data type: Optional[Boolean]
Flag to enable HTTPS without SSL verification
Data type: Optional[String]
Description of the snapshot, when creating.
Data type: Optional[Boolean]
Snapshot the VMs memory, when creating.
Data type: Optional[Boolean]
Quiesce/flush the VMs filesystem when creating the snapshot
Data type: Optional[String]
Action to perform on the snapshot, 'create' or 'delete'
Type: Puppet Language
Returns an array of names, one for each target, based on the $name_property
The patching::target_names function.
Returns: Array[String]
Array of names, one for each target
Data type: TargetSpec
List of targets to extract the name from
Data type: Enum['hostname', 'name', 'uri']
Property in the Target to use as the name
Collects information about available updates on a target system
Supports noop? true
Data type: Optional[String]
What update provider to use. For Linux (RHEL, Debian, SUSE, etc.) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Collects information about available updates on a target system
Supports noop? true
Data type: Optional[String[1]]
What update provider to use. For Linux (RHEL, Debian, etc) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Collects information about available updates on a target system
Supports noop? true
Data type: Optional[String[1]]
What update provider to use. For Linux (RHEL, Debian, etc) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Removes/clears the target's update cache. For RHEL/CentOS this means a yum clean all
. For Debian this means a apt update
. For Windows this means a Windows Update refresh.
Supports noop? false
Removes/clears the target's update cache. For RHEL/CentOS this means a yum clean all
. For Debian this means a apt update
. For Windows this means a Windows Update refresh.
Supports noop? false
Removes/clears the target's update cache. For RHEL/CentOS this means a yum clean all
. For Debian this means a apt update
. For Windows this means a Windows Update refresh.
Supports noop? false
Updates the targets update cache. For RHEL/CentOS this means a yum clean expire-cache
. For Debian this means a apt update
. For Windows this means a Windows Update refresh.
Supports noop? true
Updates the targets update cache. For RHEL/CentOS this means a yum clean expire-cache
. For Debian this means a apt update
.
Supports noop? true
Updates the targets update cache. For Windows this means a Windows Update refresh.
Supports noop? true
Reads the update history from the JSON 'result_file'.
Supports noop? false
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. This is data that was written by patching::update. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/PuppetLabs/patching/patching.json
Create or remove alert silences for hosts in Prometheus.
Supports noop? true
Data type: Variant[String[1], Array[String[1]]]
List of hostnames for targets in Prometheus that will have monitoring alerts either enabled or disabled.
Data type: Enum['enable', 'disable']
Action to perform on monitored targets. 'enable' will enable monitoring alerts. 'disable' will disable monitoring alerts on targets.
Data type: String[1]
FQDN of the Prometheus server to create an alert silence for
Data type: Optional[Integer]
How long the alert silence will be alive for
Data type: Optional[Enum['minutes', 'hours', 'days', 'weeks']]
Goes with the silence duration to determine how long the alert silence will be alive for
Enable or disable monitoring alerts on hosts in SolarWinds.
Supports noop? true
Data type: Variant[String[1], Array[String[1]]]
List of hostnames or IP addresses for targets in SolarWinds that will have monitoring alerts either enabled or disabled.
Data type: Optional[String[1]]
Property to use when looking up an Orion.Node in SolarWinds from a Bolt::Target. By default we check to see if the node is an IP address, if it is then we use the 'IPAddress' property, otherwise we use 'DNS'. If you want to change what the 'other' property is when the node name isn't an IP address, then specify this property.
Data type: Enum['enable', 'disable']
Action to perform on monitored targets. 'enable' will enable monitoring alerts. 'disable' will disable monitoring alerts on targets.
Run post-update script on target host(s), only if it exists. If the script doesn't exist or isn't executable, then this task succeeds (this allows us to run thist task on all hosts, even if they don't have a post-update script).
Supports noop? true
Data type: Optional[String[1]]
Absolute path of the script to execute. If no script name is passed on Linux hosts a default is used: /opt/patching/bin/post_update.sh. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/bin/post_update.ps1.
Pre-post-update definition to make bolt not throw a warning. Best to use pre_update or post_update directly.
Supports noop? true
Data type: Optional[String[1]]
Absolute path of the script to execute. If no script name is passed on Linux hosts a default is used: /opt/patching/bin/pre_update.sh. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/bin/pre_update.ps1.
Pre-post-update definition to make bolt not throw a warning. Best to use pre_update or post_update directly.
Supports noop? true
Data type: Optional[String[1]]
Absolute path of the script to execute. If no script name is passed on Linux hosts a default is used: /opt/patching/bin/pre_update.sh. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/bin/pre_update.ps1.
Run pre-update script on target host(s), only if it exists. If the script doesn't exist or isn't executable, then this task succeeds (this allows us to run thist task on all hosts, even if they don't have a pre-update script).
Supports noop? true
Data type: Optional[String[1]]
Absolute path of the script to execute. If no script name is passed on Linux hosts a default is used: /opt/patching/bin/pre_update.sh. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/bin/pre_update.ps1.
Gather system facts using 'puppet facts'. Puppet agent MUST be installed for this to work.
Supports noop? false
Checks if a reboot is pending
Supports noop? false
Checks if a reboot is pending
Supports noop? false
Checks if a reboot is pending
Supports noop? false
Creates or deletes snapshots on a set of KVM/Libvirt hypervisors
Supports noop? true
Data type: Variant[String[1], Array[String[1]]]
List of VM names, in KVM/Libvirt these are called domains.
Data type: Optional[String[1]]
Name of the snapshot
Data type: Optional[String[1]]
Description of the snapshot
Data type: Optional[Boolean]
Snapshot the VMs memory
Data type: Optional[Boolean]
Quiesce the filesystem during the snapshot, can be a PITA.
Data type: Enum['create', 'delete']
Action to perform on the snapshots. 'create' will create new snapshots on the VMs. 'delete' will delete snapshots on the VMs.
Execute OS updates on the target. For RedHat/CentOS this runs yum update
. For Debian/Ubuntu runs apt upgrade
. For Windows this runs Windows Update and choco update
.
Supports noop? false
Data type: Optional[String]
What update provider to use. For Linux (RHEL, Debian, etc) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Data type: Optional[Array[String]]
Name of the package(s) to update. If nothing is passed then all packages will be updated. Note: this currently only works for Linux, Windows support will be added in the future for both Windows Update and Chocolatey (TODO)
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. The data is written to a log file so that you can collect it later by running patching::history. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Data type: Optional[String[1]]
Log file for OS specific output during the patching process. This file will contain OS specific (RHEL/CentOS = yum history, Debian/Ubuntu = /var/log/apt/history.log, Windows = ??) data that this task used to generate its output. If no script name is passed on Linux hosts a default is used: /var/log/patching.log. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.log
Reads the update history from the JSON 'result_file'.
Supports noop? false
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. This is data that was written by patching::update. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Reads the update history from the JSON 'result_file'.
Supports noop? false
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. This is data that was written by patching::update. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Reads the update history from the JSON 'result_file'.
Supports noop? false
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. This is data that was written by patching::update. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Execute OS updates on the target. For RedHat/CentOS this runs yum update
. For Debian/Ubuntu runs apt upgrade
. For SLES this runs zypper up
. For Windows this runs Windows Update and choco update
.
Supports noop? false
Data type: Optional[String[1]]
What update provider to use. For Linux (RHEL, Debian, SUSE, etc.) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Data type: Optional[Array[String]]
Name of the package(s) to update. If nothing is passed then all packages will be updated. Note: this currently only works for Linux, Windows support will be added in the future for both Windows Update and Chocolatey (TODO)
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. The data is written to a log file so that you can collect it later by running patching::history. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Data type: Optional[String[1]]
Log file for OS specific output during the patching process. This file will contain OS specific (RHEL/CentOS = yum history, Debian/Ubuntu = /var/log/apt/history.log, SLES = /var/log/zypp/history, Windows = ??) data that this task used to generate its output. If no script name is passed on Linux hosts a default is used: /var/log/patching.log. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.log
Execute OS updates on the target. For RedHat/CentOS this runs yum update
. For Debian/Ubuntu runs apt upgrade
. For Windows this runs Windows Update and choco update
.
Supports noop? false
Data type: Optional[String[1]]
What update provider to use. For Linux (RHEL, Debian, etc) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Data type: Optional[Array[String]]
Name of the package(s) to update. If nothing is passed then all packages will be updated. Note: this currently only works for Linux, Windows support will be added in the future for both Windows Update and Chocolatey (TODO)
Data type: Optional[String[1]]
Log file for patching results. This file will contain the JSON output that is returned from these tasks. The data is written to a log file so that you can collect it later by running patching::history. If no script name is passed on Linux hosts a default is used: /var/log/patching.json. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.json
Data type: Optional[String[1]]
Log file for OS specific output during the patching process. This file will contain OS specific (RHEL/CentOS = yum history, Debian/Ubuntu = /var/log/apt/history.log, Windows = ??) data that this task used to generate its output. If no script name is passed on Linux hosts a default is used: /var/log/patching.log. If no script name is passed on Windows hosts a default is used: C:/ProgramData/patching/log/patching.log
It serves as a showcase of how all of the building blocks in this module can be tied together to create a full blown patching workflow. This is a great initial workflow to patch servers. We fully expect others to take this workflow as a build-block and customize it to meet their needs.
bolt plan run patching --targets linux_patching,windows_patching
CLI - Disable snapshot creation, because an old patching run failed and we have an old snapshot to rely on
bolt plan run patching --targets linux_patching,windows_patching snapshot_create=false
bolt plan run patching --targets linux_patching,windows_patching snapshot_delete=true
# sometime in the future, delete the snapshots
bolt plan run patching::snapshot_vmare --targets linux_patching,windows_patching action='delete'
bolt plan run patching --targets linux_patching pre_update_plan='mymodule::pre_update' post_update_plan='mymodule::post_update'
bolt plan run patching --targets linux_patching,windows_patching --reboot_wait 600
The following parameters are available in the patching
plan:
targets
filter_offline_targets
monitoring_enabled
monitoring_plan
update_provider
pre_update_plan
post_update_plan
reboot_message
reboot_strategy
reboot_wait
snapshot_plan
snapshot_create
snapshot_delete
report_format
report_file
noop
Data type: TargetSpec
Set of targets to run against.
Data type: Boolean
Flag to determine if offline targets should be filtered out of the list of targets
returned by this plan. If true, when running the puppet_agent::version
check, any targets that return an error will be filtered out and ignored.
Those targets will not be returned in any of the data structures in the result of
this plan. If false, then any targets that are offline will cause this plan to error
immediately when performing the online check. This will result in a halt of the
patching process.
Default value: false
Data type: Optional[Boolean]
Flag to enable/disable the execute of the monitoring_plan.
This is useful if you don't want to call out to a monitoring system during provisioning.
To configure this globally, use the patching_monitoring_enabled
var.
Default value: undef
Data type: Optional[String]
Name of the plan to use for disabling/enabling monitoring steps of the workflow.
To configure this globally, use the patching_monitoring_plan
var.
Default value: undef
Data type: Optional[String]
What update provider to use. For Linux (RHEL, Debian, SUSE, etc.) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Default value: undef
Data type: Optional[String]
Name of the plan to use for executing the pre-update step of the workflow.
Default value: undef
Data type: Optional[String]
Name of the plan to use for executing the post-update step of the workflow.
Default value: undef
Data type: Optional[String]
Message displayed to the user prior to the system rebooting
Default value: undef
Data type: Optional[Enum['only_required', 'never', 'always']]
Determines the reboot strategy for the run.
- 'only_required' only reboots hosts that require it based on info reported from the OS
- 'never' never reboots the hosts
- 'always' will reboot the host no matter what
Default value: undef
Data type: Optional[Integer]
Time in seconds that the plan waits before continuing after a reboot. This is necessary in case one of the groups affects the availability of a previous group. Two use cases here:
- A later group is a hypervisor. In this instance the hypervisor will reboot causing the VMs to go offline and we need to wait for those child VMs to come back up before collecting history metrics.
- A later group is a linux router. In this instance maybe the patching of the linux router affects the reachability of previous hosts.
Default value: undef
Data type: Optional[String]
Name of the plan to use for executing snaphot creation and deletion steps of the workflow
You can also pass 'disabled'
or undef'
as an easy way to disable both creation and deletion.
Default value: undef
Data type: Optional[Boolean]
Flag to enable/disable creating snapshots before patching groups.
A common usecase to disabling snapshot creation is that, say you run patching
with snapshot_create
enabled and something goes wrong during patching and
the run fails. The sanpshot still exists and you want to retry patching
but don't want to create ANOTHER snapshot on top of the one we already have.
In this case we would pass in snapshot_create=false
when running the second time.
Default value: undef
Data type: Optional[Boolean]
Flag to enable/disable deleting snapshots after patching groups.
A common usecase to disable snapshot deletion is that, say you want to patch your
hosts and wait a few hours for application teams to test after you're done patching.
In this case you can run with snapshot_delete=false
and then a few hours later
you can run the patching::snapshot_vmware action=delete
sometime in the future.
Default value: undef
Data type: Optional[Enum['none', 'pretty', 'csv']]
The method of formatting the report data.
Default value: undef
Data type: Optional[String]
Path of the filename where the report should be written. Default = 'patching_report.csv'. If you would like to disable writing the report file, specify a value of 'disabled'. NOTE: If you're running PE, then you'll need to disable writing reports because it will fail when running from the console.
Default value: undef
Data type: Boolean
Flag to enable noop mode for the underlying plans and tasks.
Default value: false
This uses the patching::available_updates
task to query each Target's
Operating System for available updates. The results from the OS are parsed and formatted
into easy to consume JSON data, such that further code can be written against the
output.
- RHEL: This ultimately performs a
yum check-update
. - Ubuntu: This ultimately performs a
apt upgrade --simulate
. - Windows:
- Windows Update API: Queries the WUA for updates. This is the standard update mechanism for Windows.
- Chocolatey: If installed, runs
choco outdated
. If not installed, Chocolatey is ignored.
bolt plan run patching::available_updates --targets linux_hosts
bolt plan run patching::available_updates --targets linux_hosts format=csv
run_plan('patching::available_updates', $linux_hosts)
run_plan('patching::available_updates', $linux_hosts,
format => 'csv')
The following parameters are available in the patching::available_updates
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['none', 'pretty', 'csv']
Output format for printing user-friendly information during the plan run. This also determines the format of the information returned from this plan.
- 'none' : Prints no data to the screen. Returns the raw ResultSet from the patching::available_updates task
- 'pretty' : Prints the data out in a easy to consume format, one line per host, showing the number of available updates per host. Returns a Hash containing two keys: 'has_updates' - an array of TargetSpec that have updates available, 'no_updates' - an array of hosts that have no updates available.
- 'csv' : Prints and returns CSV formatted data, one row for each update of each host.
Default value: 'pretty'
Data type: Boolean
Run this plan in noop mode, meaning no changes will be made to end systems. In this case, noop mode has no effect.
Default value: false
Data type: Optional[String]
What update provider to use. For Linux (RHEL, Debian, SUSE, etc.) this parameter is not used. For Windows the available values are: 'windows', 'chocolatey', 'all' (both 'windows' and 'chocolatey'). The default value for Windows is 'all'. If 'all' is passed and Chocolatey isn't installed then Chocolatey will simply be skipped. If 'chocolatey' is passed and Chocolatey isn't installed, then this will error.
Default value: undef
Online checks are done querying for the node's Puppet version using the
puppet_agent::version
task.
This plan is designed to be used ad-hoc as a quick health check of your inventory.
It is the intention of this plan to be used as "first pass" when onboarding new targets
into a Bolt rotation.
One would build their inventory file of all targets from their trusted data sources.
Then take the inventory files and run this plan against them to isolate problem targets
and remediate them.
Once this plan runs successfuly on your inventory, you know that Bolt can connect
and can begin the patching proces.
There are no results returned by this plan, instead data is pretty-printed to the screen in two lists:
- List of targets that failed to connect. This list is a YAML list where each line is the name of a Target that failed to connect. The intention here is that you can use this YAML list to modify your inventory and remove these problem hosts from your groups.
- Details for each failed target. This provides details about the error that occured when connecting. Failures can occur for many reasons, host being offline host not listening on the right port, firewall blocking, invalid credentials, etc. The idea here is to give the end-user a easily digestible summary so that action can be taken to remediate these hosts.
bolt plan run patching::check_online
The following parameters are available in the patching::check_online
plan:
Data type: TargetSpec
Set of targets to run against.
Executes the puppet_agent::version
task to check if Puppet is installed
on all of the targets. Once finished, the result is split into two groups:
- Targets with puppet
- Targets with no puppet
The targets with puppet are queried for facts using the patching::puppet_facts
plan.
Targets without puppet are queried for facts using the simpler facts
plan.
This plan is designed to be the first plan executed in a patching workflow.
It can be used to stop the patching process if any hosts are offline by setting
filter_offline_targets=false
(default). It can also be used
to patch any hosts that are currently available and ignoring any offline targets
by setting filter_offline_targets=true
.
bolt plan run patching::check_puppet --targets linux_hosts
bolt plan run patching::check_puppet --targets linux_hosts filter_offline_targets=true
$results = run_plan('patching::check_puppet', $linux_hosts)
$targets_has_puppet = $results['has_puppet']
$targets_no_puppet = $results['no_puppet']
$targets_all = $results['all']
$results = run_plan('patching::check_puppet', $linux_hosts,
filter_offline_targets => true)
$targets_online_has_puppet = $results['has_puppet']
$targets_online_no_puppet = $results['no_puppet']
$targets_online = $results['all']
The following parameters are available in the patching::check_puppet
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Boolean
Flag to determine if offline targets should be filtered out of the list of targets
returned by this plan. If true, when running the puppet_agent::version
check, any targets that return an error will be filtered out and ignored.
Those targets will not be returned in any of the data structures in the result of
this plan. If false, then any targets that are offline will cause this plan to error
immediately when performing the online check. This will result in a halt of the
patching process.
Default value: false
The patching::deploy_scripts class.
bolt plan run patching::deploy_scripts scripts='{"pre_patch.sh": {"source": "puppet:///modules/test/patching/pre_patch.sh"}}'
bolt plan run patching::deploy_scripts scripts='{"pre_patch.sh": {"source": "puppet:///modules/test/patching/pre_patch.sh"}, "post_patch.sh": {"source": "puppet:///modules/test/patching/post_patch.sh"}}'
The following parameters are available in the patching::deploy_scripts
plan:
Data type: Optional[String]
Default owner of installed scripts
Default value: undef
Data type: Optional[String]
Default group of installed scripts
Default value: undef
Data type: Optional[String]
Default file mode of installed scripts
Default value: undef
Data type: TargetSpec
Data type: Hash
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Data type: Optional[String]
Default value: undef
Sets patching facts on targets
bolt plan run patching::get_facts --targets xxx
bolt plan run patching::get_facts --targets xxx names='["fact1", "fact2"]'
The following parameters are available in the patching::get_facts
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Variant[String, Array[String]]
Name or list of fact names to retrieve from the targets
Default value: ['patching_group']
A very common requirement when running individual plans from the commandline is that each plan would need to perform the following steps:
- Convert the TargetSpec from a string into an Array[Target] using
get_targets($targets)
- Check for targets that are online (calls plan
patching::check_puppet
- Gather facts about the targets
This plan combines all of that into one so that it can be reused in all of the other plans within this module. It also adds some smart checking so that, if multiple plans invoke each other, each of which call this plan. The online check and facts gathering only hapens once.
plan mymodule::myplan (
TargetSpec $targets
) {
$targets = run_plan('patching::get_targets', $targets)
# do normal stuff with your $targets
}
The following parameters are available in the patching::get_targets
plan:
Data type: TargetSpec
Set of targets to run against.
Disable monitoring for targets in multiple services
vars:
patching_monitoring_plan: 'patching::monitoring_multiple'
patching_monitoring_plan_multiple:
- plan: 'patching::monitoring_solarwinds'
target: 'solarwinds'
- plan: 'patching::monitoring_prometheus'
target: 'prometheus'
groups:
- name: solarwinds
config:
transport: remote
remote:
port: 17778
username: 'domain\svc_bolt_sw'
password:
_plugin: pkcs7
encrypted_value: >
ENC[PKCS7,xxx]
targets:
- solarwinds.domain.tld
- name: prometheus
config:
transport: remote
remote:
username: 'domain\prom_user'
password:
_plugin: pkcs7
encrypted_value: >
ENC[PKCS7,xxx]
targets:
- prometheus.domain.tld
The following parameters are available in the patching::monitoring_multiple
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['enable', 'disable']
What action to perform on the monitored targets:
enable
Resumes monitoring alerts- 'disable' Supresses monitoring alerts
Data type: Boolean
Flag to enable noop mode.
Default value: false
Data type: Array[Hash]
Default value: .vars['patching_monitoring_plan_multiple']
Create or remove alert silences for hosts in Prometheus.
vars:
patching_monitoring_target: 'prometheus'
patching_monitoring_silence_duration: 24
patching_monitoring_silence_units: 'hours'
groups:
- name: prometheus
config:
transport: remote
remote:
username: 'domain\prom_user'
password:
_plugin: pkcs7
encrypted_value: >
ENC[PKCS7,xxx]
targets:
- prometheus.domain.tld
The following parameters are available in the patching::monitoring_prometheus
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['enable', 'disable']
What action to perform on the monitored targets:
enable
Resumes monitoring alerts- 'disable' Supresses monitoring alerts
Data type: Optional[Integer]
How long the alert silence will be alive for
Default value: undef
Data type: Optional[Enum['minutes', 'hours', 'days', 'weeks']]
Goes with the silence duration to determine how long the alert silence will be alive for
Default value: undef
Data type: Optional[TargetSpec]
Name or reference to the remote transport target of the Prometheus server. The remote transport should have the following properties:
- [String] username Username for authenticating with Prometheus
- [Password] password Password for authenticating with Prometheus
Default value: undef
Data type: Boolean
Flag to enable noop mode. When noop mode is enabled no snapshots will be created or deleted.
Default value: false
TODO config variables
vars:
patching_monitoring_plan: 'patching::monitoring_solarwinds'
patching_monitoring_target: 'solarwinds'
groups:
- name: solarwinds
config:
transport: remote
remote:
port: 17778
username: 'domain\svc_bolt_sw'
password:
_plugin: pkcs7
encrypted_value: >
ENC[PKCS7,xxx]
targets:
- solarwinds.domain.tld
The following parameters are available in the patching::monitoring_solarwinds
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['enable', 'disable']
What action to perform on the monitored targets:
enable
Resumes monitoring alerts- 'disable' Supresses monitoring alerts
Data type: Optional[Enum['name', 'uri']]
Determines what property on the Target object will be used as the name when mapping the Target to a Node in SolarWinds.
uri
: use theuri
property on the Target. This is preferred because If you specify a list of Targets in the inventory file, the value shown in that list is set as theuri
and not thename
, in this casename
will beundef
.name
: use thename
property on the Target, this is not preferred becausename
is usually a short name or nickname.
Default value: undef
Data type: Optional[TargetSpec]
Name or reference to the remote transport target of the Monitoring server. This will be used when to determine how to communicate with the SolarWinds API. The remote transport should have the following properties:
- [Integer] port Port to use when communicating with SolarWinds API (default: 17778)
- [String] username Username for authenticating with the SolarWinds API
- [Password] password Password for authenticating with the SolarWinds API
Default value: undef
Data type: Optional[String[1]]
Determines what property to match in SolarWinds when looking up targets. By default we determine if the target's name is an IP address, if it is then we use the 'IPAddress' property, otherwise we use whatever property this is set to. Available options that we've seen used are 'DNS' if the target's name is a DNS FQDN, or 'Caption' if you're looking up by a nick-name for the target. This can really be any field on the Orion.Nodes table.
Default value: undef
Data type: Boolean
Flag to enable noop mode. When noop mode is enabled no snapshots will be created or deleted.
Default value: false
When patching hosts it is common that you don't want to patch them all at the same time, for obvious reasons. To facilitate this we devised the concept of a "patching order". Patching order is a mechanism to allow targets to be organized into groups and then sorted so that a custom order can be defined for your specific usecase.
The way one assigns a patching order to a target or group is using vars
in the Bolt inventory file.
Example:
---
groups:
- name: primary_nodes
vars:
patching_order: 1
targets:
- sql01.domain.tld
- name: backup_nodes
vars:
patching_order: 2
targets:
- sql02.domain.tld
When the patching_order
is defined at the group level, it is inherited
by all targets within that group.
The reason this plan exists is that there is no concept of a "group" in the bolt
runtime, so we need to artificially recreate them using our patching_order
vars paradigm.
An added benefit to this paradigm is that you may have grouped your targets logically on a different dimension, say by application. If it's OK that multiple applications be patched at the same time, we can assign the same patching order to multiple groups in the inventory. Then, when run through this plan, they will be aggregated together into one large group of targets that will all be patched concurrently.
Example, app_xxx and app_zzz both can be patched at the same time, but app_yyy needs to go later in the process:
---
groups:
- name: app_xxx
vars:
patching_order: 1
targets:
- xxx
- name: app_yyy
vars:
patching_order: 2
targets:
- yyy
- name: app_zzz
vars:
patching_order: 1
targets:
- zzz
This is returned as an Array, because an Array has a defined order when
you iterate over it using .each
. Ordering is important in patching
so we wanted this to be very concrete.
$ordered_groups = run_plan('patching::ordered_groups', $targets)
$ordered_groups.each |$group_hash| {
$group_order = $group_hash['order']
$group_targets = $group_hash['targets']
# run your patching process for the group
}
The following parameters are available in the patching::ordered_groups
plan:
Data type: TargetSpec
Set of targets to created ordered groups of.
Often in patching it is necessary to run custom commands before/after updates are applied to a host. This plan allows for that customization to occur.
By default it executes a Shell script on Linux and a PowerShell script on Windows hosts. The default script paths are:
- Linux:
/opt/patching/bin/post_update.sh
- Windows:
C:\ProgramData\patching\bin\post_update.ps1
One can customize the script paths by overriding them on the CLI, or when calling the plan
using the script_linux
and script_windows
parameters.
The script paths can also be customzied in the inventory configuration vars
:
Example:
vars:
patching_post_update_script_windows: C:\scripts\patching.ps1
patching_post_update_script_linux: /usr/local/bin/mysweetpatchingscript.sh
groups:
# these targets will use the pre patching script defined in the vars above
- name: regular_nodes
targets:
- tomcat01.domain.tld
# these targets will use the customized patching script set for this group
- name: sql_nodes
vars:
patching_post_update_script_linux: /bin/sqlpatching.sh
targets:
- sql01.domain.tld
bolt plan run patching::post_update --targets all_hosts
bolt plan run patching::post_update --targets all_hosts script_linux='/my/sweet/script.sh' script_windows='C:\my\sweet\script.ps1'
run_plan('patching::post_update', $all_hosts)
run_plan('patching::post_update', $all_hosts,
script_linux => '/my/sweet/script.sh',
script_windows => 'C:\my\sweet\script.ps1')
The following parameters are available in the patching::post_update
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: String[1]
Path to the script that will be executed on Linux targets.
Default value: '/opt/patching/bin/post_update.sh'
Data type: String[1]
Path to the script that will be executed on Windows targets.
Default value: 'C:\ProgramData\patching\bin\post_update.ps1'
Data type: Boolean
Flag to enable noop mode for the underlying plans and tasks.
Default value: false
Common entry point for executing the pre/post update custom scripts
- See also
- patching::pre_update
- patching::post_update
The following parameters are available in the patching::pre_post_update
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: String[1]
Name of the pre/post update task to execute.
Data type: Optional[String[1]]
Path to the script that will be executed on Linux targets.
Default value: undef
Data type: Optional[String[1]]
Path to the script that will be executed on Windows targets.
Default value: undef
Data type: Boolean
Flag to enable noop mode for the underlying plans and tasks.
Default value: false
Often in patching it is necessary to run custom commands before/after updates are applied to a host. This plan allows for that customization to occur.
By default it executes a Shell script on Linux and a PowerShell script on Windows hosts. The default script paths are:
- Linux:
/opt/patching/bin/pre_update.sh
- Windows:
C:\ProgramData\patching\bin\pre_update.ps1
One can customize the script paths by overriding them on the CLI, or when calling the plan
using the script_linux
and script_windows
parameters.
The script paths can also be customzied in the inventory configuration vars
:
Example:
vars:
patching_pre_update_script_windows: C:\scripts\patching.ps1
patching_pre_update_script_linux: /usr/local/bin/mysweetpatchingscript.sh
groups:
# these targets will use the pre patching script defined in the vars above
- name: regular_nodes
targets:
- tomcat01.domain.tld
# these targets will use the customized patching script set for this group
- name: sql_nodes
vars:
patching_pre_update_script_linux: /bin/sqlpatching.sh
targets:
- sql01.domain.tld
bolt plan run patching::pre_update --targets all_hosts
bolt plan run patching::pre_update --targets all_hosts script_linux='/my/sweet/script.sh' script_windows='C:\my\sweet\script.ps1'
run_plan('patching::pre_update', $all_hosts)
run_plan('patching::pre_update', $all_hosts,
script_linux => '/my/sweet/script.sh',
script_windows => 'C:\my\sweet\script.ps1')
The following parameters are available in the patching::pre_update
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: String[1]
Path to the script that will be executed on Linux targets.
Default value: '/opt/patching/bin/pre_update.sh'
Data type: String[1]
Path to the script that will be executed on Windows targets.
Default value: 'C:\ProgramData\patching\bin\pre_update.ps1'
Data type: Boolean
Flag to enable noop mode for the underlying plans and tasks.
Default value: false
This is inspired by: https://github.com/puppetlabs/puppetlabs-facts/blob/master/plans/init.pp
Except instead of just running facter
it runs puppet facts
to set additional
facts that are only present when in the context of puppet.
Under the hood it is executeing the patching::puppet_facts
task.
The following parameters are available in the patching::puppet_facts
plan:
Data type: TargetSpec
Set of targets to run against.
Patching in different environments comes with various unique requirements, one of those is rebooting hosts. Sometimes hosts need to always be reboot, othertimes never rebooted.
To provide this flexibility we created this function that wraps the reboot
plan with
a strategy
that is controllable as a parameter. This provides flexibilty in
rebooting specific targets in certain ways (by group). Along with the power to expand
our strategy offerings in the future.
The following parameters are available in the patching::reboot_required
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['only_required', 'never', 'always']
Determines the reboot strategy for the run.
- 'only_required' only reboots hosts that require it based on info reported from the OS
- 'never' never reboots the hosts
- 'always' will reboot the host no matter what
Default value: undef
Data type: String
Message displayed to the user prior to the system rebooting
Default value: undef
Data type: Integer
Time in seconds that the plan waits before continuing after a reboot. This is necessary in case one of the groups affects the availability of a previous group. Two use cases here:
- A later group is a hypervisor. In this instance the hypervisor will reboot causing the VMs to go offline and we need to wait for those child VMs to come back up before collecting history metrics.
- A later group is a linux router. In this instance maybe the patching of the linux router affects the reachability of previous hosts.
Default value: undef
Data type: Boolean
Flag to determine if this should be a noop operation or not. If this is a noop, no hosts will ever be rebooted, however the "reboot required" information will still be queried and returned.
Default value: false
For Linux targets the facts will be written to /etc/facter/facts.d/patching.yaml
.
For Windows targets the facts will be written to 'C:/ProgramData/PuppetLabs/facter/facts.d/patching.yaml'
.
The contents of the patching.yaml
file will be overwritten by this plan.
TODO: Provide an option to merge with existing facts.
Once the facts are written, by default, the facts will be ran and uploaded to PuppetDB.
If you wish to disable this, simply set upload=false
bolt plan run patching::set_facts --targets xxx patching_group=tuesday_night
bolt plan run patching::set_facts --targets xxx custom_facts='{"fact1": "blah"}'
bolt plan run patching::set_facts --targets xxx patching_group=tuesday_night upload=false
The following parameters are available in the patching::set_facts
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Optional[String]
Name of the patching group that the targets are a member of. This will be the value for the
patching_group
fact.
Default value: undef
Data type: Hash
Hash of custom facts that will be set on these targets. This can be anything you like and will merged with the other facts above.
Default value: {}
Data type: Boolean
After setting the facts, perform a puppet facts upload
so the new
facts are stored in PuppetDB.
Default value: true
Runs commands on the CLI of the KVM/Libvirt hypervisor host.
The following parameters are available in the patching::snapshot_kvm
plan:
targets
action
target_name_property
snapshot_name
snapshot_description
snapshot_memory
snapshot_quiesce
hypervisor_targets
noop
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['create', 'delete']
What action to perform on the snapshots:
create
creates a new snapshot- 'delete' deletes snapshots by matching the
snapshot_name
passed in.
Data type: Optional[Enum['hostname', 'name', 'uri']]
Determines what property on the Target object will be used as the VM name when mapping the Target to a VM in vSphere.
uri
: use theuri
property on the Target. This is preferred because If you specify a list of Targets in the inventory file, the value shown in that list is set as theuri
and not thename
, in this casename
will beundef
.name
: use thename
property on the Target, this is not preferred becausename
is usually a short name or nickname.hostname
: use thehostname
value to use host component ofuri
property on the Target this can be useful if VM name doesn't include domain name
Default value: undef
Data type: Optional[String[1]]
Name of the snapshot
Default value: undef
Data type: Optional[String]
Description of the snapshot
Default value: undef
Data type: Optional[Boolean]
Capture the VMs memory in the snapshot
Default value: undef
Data type: Optional[Boolean]
Quiesce/flush the filesystem when snapshotting the VM. This requires VMware tools be installed in the guest OS to work properly.
Default value: undef
Data type: Optional[TargetSpec]
Name or reference to the targets of the KVM hypervisors. We will login to this host an run the snapshot tasks so that the local CLI can be used. Default target name is "kvm_hypervisors", this can be a group of targets too!
Default value: undef
Data type: Boolean
Flag to enable noop mode. When noop mode is enabled no snapshots will be created or deleted.
Default value: false
Communicates to the vSphere API from the local Bolt control node using the rbvmomi Ruby gem.
To install the rbvmomi gem on the bolt control node:
/opt/puppetlabs/bolt/bin/gem install --user-install rbvmomi
TODO config variables
The following parameters are available in the patching::snapshot_vmware
plan:
targets
action
target_name_property
vsphere_host
vsphere_username
vsphere_password
vsphere_datacenter
vsphere_insecure
snapshot_name
snapshot_description
snapshot_memory
snapshot_quiesce
noop
Data type: TargetSpec
Set of targets to run against.
Data type: Enum['create', 'delete']
What action to perform on the snapshots:
create
creates a new snapshot- 'delete' deletes snapshots by matching the
snapshot_name
passed in.
Data type: Optional[Enum['hostname', 'name', 'uri']]
Determines what property on the Target object will be used as the VM name when mapping the Target to a VM in vSphere.
uri
: use theuri
property on the Target. This is preferred because If you specify a list of Targets in the inventory file, the value shown in that list is set as theuri
and not thename
, in this casename
will beundef
.name
: use thename
property on the Target, this is not preferred becausename
is usually a short name or nickname.hostname
: use thehostname
value to use host component ofuri
property on the Target this can be useful if VM name doesn't include domain name
Default value: undef
Data type: String[1]
Hostname of the vSphere server that we're going to use to create snapshots via the API.
Default value: .vars['vsphere_host']
Data type: String[1]
Username to use when authenticating with the vSphere API.
Default value: .vars['vsphere_username']
Data type: String[1]
Password to use when authenticating with the vSphere API.
Default value: .vars['vsphere_password']
Data type: String[1]
Name of the vSphere datacenter to search for VMs under.
Default value: .vars['vsphere_datacenter']
Data type: Boolean
Flag to enable insecure HTTPS connections by disabling SSL server certificate verification.
Default value: .vars['vsphere_insecure']
Data type: Optional[String[1]]
Name of the snapshot
Default value: undef
Data type: Optional[String]
Description of the snapshot
Default value: undef
Data type: Optional[Boolean]
Capture the VMs memory in the snapshot
Default value: undef
Data type: Optional[Boolean]
Quiesce/flush the filesystem when snapshotting the VM. This requires VMware tools be installed in the guest OS to work properly.
Default value: undef
Data type: Boolean
Flag to enable noop mode. When noop mode is enabled no snapshots will be created or deleted.
Default value: false
When executing the patching::update
task, the data that is returned to Bolt
is also written into a "results" file. This plan reads the last JSON document
from that results file, then formats the results in various ways.
This is useful for gather patching report data on a fleet of servers.
If you're using this in a larger workflow and you've run patching::update
inline.
You can pass the ResultSet from that task into the history
parameter of this
plan and we will skip retrieving the history from the targets and simply use
that data.
By default the report is also written to a file patching_report.csv
.
If you would like to disable this you can pass in undef
or 'disabled'
to
report_file
parameter. You can also customize this as by specifying the
patching_report_file
var on the target or group.
Patching format can also be customized using the inventory var patching_report_format
on the target or group.
The following parameters are available in the patching::update_history
plan:
Data type: TargetSpec
Set of targets to run against.
Data type: Optional[ResultSet]
Optional ResultSet from the patching::update
or patching::update_history
tasks
that contains update result data to be formatted.
Default value: undef
Data type: Optional[String]
Optional filename to save the formatted repot into.
If undef
or 'disabled'
are passed, then no report file will be written.
NOTE: If you're running PE, then you'll need to disable writing reports because it will
fail when running from the console.
Default value: 'patching_report.csv'
Data type: Enum['none', 'pretty', 'csv']
The method of formatting to use for the data.
Default value: 'pretty'