Skip to content

Commit 2768036

Browse files
committed
2 parents 161e612 + b4d176f commit 2768036

17 files changed

Lines changed: 424 additions & 256 deletions

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
os: linux
23
dist: xenial
34
language: ruby
45
cache: bundler
@@ -15,15 +16,15 @@ script:
1516
- 'bundle exec rake $CHECK'
1617
bundler_args: --without system_tests
1718
rvm:
18-
- 2.5.3
19+
- 2.5.7
1920
stages:
2021
- static
2122
- spec
2223
- acceptance
2324
-
2425
if: tag =~ ^v\d
2526
name: deploy
26-
matrix:
27+
jobs:
2728
fast_finish: true
2829
include:
2930
-
@@ -35,7 +36,7 @@ matrix:
3536
stage: spec
3637
-
3738
env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec
38-
rvm: 2.5.3
39+
rvm: 2.5.7
3940
stage: spec
4041
-
4142
env: DEPLOY_TO_FORGE=yes

CHANGELOG.md

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

55
## Development
66

7+
8+
## Release 1.0.1 (2020-03-04)
9+
10+
* Ensure the `patching.json` file exists on Windows by creating a blank file if it was previously missing.
11+
12+
Contributed by Bill Sirinek (@sirinek)
13+
14+
* use `name` instead of `host` to better represent targets in inventory
15+
16+
Contributed by Vadym Chepkov (@vchepkov)
17+
18+
* Fixed a bug where if `patching::update_history` task was called and no results were returned
19+
the `patching::update_history` plan would fail. Now, we default to an empty array so a 0
20+
is displayed.
21+
22+
Contributed by Nick Maludy (@nmaludy)
23+
24+
## Release 1.0.0 (2020-02-28)
25+
726
* **BREAKING CHANGE**
827
Converted from `nodes` to `targets` for all plans and tasks. This is in support of Bolt `2.0`.
928
Any calling plans or CLI will need to use the `targets` parameter to pass in the hosts
1029
to be patched. (Feature)
1130

1231
Contributed by Nick Maludy (@nmaludy)
1332

33+
* Fixed inconsistent documentation for result file location, proper location is: `C:/ProgramData/patching/log/patching.json`. (Bug Fix) #28
34+
35+
Contributed by Nick Maludy (@nmaludy)
36+
37+
* Added documentation for patching with PE and `pcp` timeouts. (Documentation) #28
38+
39+
Contributed by Nick Maludy (@nmaludy)
40+
41+
* PDK sync to 1.17.0 template (Enhancement)
42+
43+
Contributed by Nick Maludy (@nmaludy)
1444

1545
## Release 0.5.0 (2020-02-20)
1646

README.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,32 @@
1313

1414
- [Description](#description)
1515
- [Setup](#setup)
16-
- [Setup Requirements](#setup-requirements)
17-
- [Getting started](#getting-started)
16+
- [Setup Requirements](#setup-requirements)
17+
- [Quick Start](#quick-start)
1818
- [Architecture](#architecture)
1919
- [Design](#design)
2020
- [Patching Workflow](#patching-workflow)
2121
- [Usage](#usage)
22-
- [Check for available updates](#check-for-available-updates)
23-
- [Create snapshots](#create-snapshots)
24-
- [Perform pre-patching checks and actions](#perform-pre-patching-checks-and-actions)
25-
- [Run a the full patching workflow end-to-end](#run-a-the-full-patching-workflow-end-to-end)
22+
- [Check for available updates](#check-for-available-updates)
23+
- [Disable monitoring](#disable-monitoring)
24+
- [Create snapshots](#create-snapshots)
25+
- [Perform pre-patching checks and actions](#perform-pre-patching-checks-and-actions)
26+
- [Deploying pre/post patching scripts](#deploying-prepost-patching-scripts)
27+
- [Run a the full patching workflow end-to-end](#run-a-the-full-patching-workflow-end-to-end)
28+
- [Patching with Puppet Enterprise (PE)](#patching-with-puppet-enterprise-pe)
2629
- [Configuration Options](#configuration-options)
2730
- [Reference](#reference)
2831
- [Limitations](#limitations)
2932
- [Development](#development)
3033
- [Contributors](#contributors)
3134

35+
3236
## Description
3337

3438
A framework for building patching workflows. This module is designed to be used as building
3539
blocks for complex patching environments of Windows and Linux (RHEL, Ubuntu) systems.
3640

37-
No Puppet agent is required on the end nodes. The node executing the patching will need to
41+
No Puppet agent is required on the end targets. The node executing the patching will need to
3842
have `bolt` installed.
3943

4044
## Setup
@@ -62,7 +66,7 @@ mod 'encore/patching'
6266
EOF
6367

6468
bolt puppetfile install
65-
bolt plan run patching::available_updates --nodes group_a
69+
bolt plan run patching::available_updates --targets group_a
6670

6771
# install rbvmomi for VMware snapshot support
6872
/opt/puppetlabs/bolt/bin/gem install --user-install rbvmomi
@@ -73,9 +77,9 @@ bolt plan run patching::available_updates --nodes group_a
7377
This module is designed to work in enterprise patching environments.
7478

7579
Assumptions:
76-
* RHEL nodes are registered to Satellite / Foreman or the internet
77-
* Ubuntu nodes are registered to Landscape or the internet
78-
* Windows nodes are registered to WSUS and Chocolatey (optional)
80+
* RHEL targets are registered to Satellite / Foreman or the internet
81+
* Ubuntu targets are registered to Landscape or the internet
82+
* Windows targets are registered to WSUS and Chocolatey (optional)
7983

8084
Registration to a central patching server is preferred for speed of software downloads
8185
and control of phased patching promotions.
@@ -90,7 +94,7 @@ these central patching server tools.
9094
`patching` is designed around `bolt` tasks and plans.
9195

9296
Individual tasks have been written to accomplish targeted steps in the patching process.
93-
Examples: `patching::available_updates` is used to check for available updates on target nodes.
97+
Examples: `patching::available_updates` is used to check for available updates on targets.
9498

9599
Plans are then used to pretty up output and tie tasks together.
96100

@@ -125,14 +129,14 @@ This workflow consists of the following phases:
125129

126130
### Check for available updates
127131

128-
This will reach out to all nodes in `group_a` in your inventory and check for any available
132+
This will reach out to all targets in `group_a` in your inventory and check for any available
129133
updates through the system's package manager:
130134
* RHEL = yum
131135
* Ubuntu = apt
132136
* Windows = Windows Update + Chocolatey (if installed)
133137

134138
``` shell
135-
bolt plan run patching::available_updates --nodes group_a
139+
bolt plan run patching::available_updates --targets group_a
136140
```
137141

138142
### Disable monitoring
@@ -144,7 +148,7 @@ This plan/task utilizes the `remote` transport []
144148

145149

146150
``` shell
147-
bolt plan run patching::monitoring_solarwinds --nodes group_a action=disable' monitoring_target=solarwinds
151+
bolt plan run patching::monitoring_solarwinds --targets group_a action=disable' monitoring_target=solarwinds
148152
```
149153
150154
### Create snapshots
@@ -155,7 +159,7 @@ be the `uri` of the node the inventory file.
155159
``` shell
156160
/opt/puppetlabs/bolt/bin/gem install rbvmomi
157161
158-
bolt plan run patching::snapshot_vmware --nodes group_a action='create' vsphere_host='vsphere.domain.tld' vsphere_username='xyz' vsphere_password='abc123' vsphere_datacenter='dctr1'
162+
bolt plan run patching::snapshot_vmware --targets group_a action='create' vsphere_host='vsphere.domain.tld' vsphere_username='xyz' vsphere_password='abc123' vsphere_datacenter='dctr1'
159163
```
160164
161165
### Perform pre-patching checks and actions
@@ -168,10 +172,10 @@ Best practice is to define and distribute these scripts as part of your normal P
168172
as part of othe role for that node.
169173
170174
``` shell
171-
bolt plan run patching::pre_update --nodes group_a
175+
bolt plan run patching::pre_update --targets group_a
172176
```
173177
174-
By default this executes the following scripts (nodes where the script doesn't exist are ignored):
178+
By default this executes the following scripts (targets where the script doesn't exist are ignored):
175179
* Linux = `/opt/patching/bin/pre_update.sh`
176180
* Windows = `C:\ProgramData\patching\pre_update.ps1`
177181

@@ -232,17 +236,46 @@ Then, for each group:
232236
* `patching::snapshot_vmware action='delete'`
233237

234238
``` shell
235-
bolt plan run patching --nodes group_a
239+
bolt plan run patching --targets group_a
240+
```
241+
242+
### Patching with Puppet Enterprise (PE)
243+
244+
When executing patching with Puppet Enterprise Bolt will use the `pcp` transport.
245+
This transport has a default timeout of `1000` seconds. Windows patching is MUCH
246+
slower than this and the timeouts will need to be increased.
247+
248+
If you do not modify this default timeout, you may experience the following error
249+
in the `patching::update` task or any other long running task:
250+
251+
``` yaml
252+
Starting: task patching::update on windowshost.company.com
253+
Finished: task patching::update with 1 failure in 1044.63 sec
254+
The following hosts failed during update:
255+
[{"target":"windowshost.company.com","action":"task","object":"patching::update","status":"failure","result":{"_output":"null","_error":{"kind":"puppetlabs.tasks/task-error","issue_code":"TASK_ERROR","msg":"The task failed with exit code unknown","details":{"exit_code":"unknown"}}},"node":"windowshost.company.com"}]
256+
```
257+
258+
Below is an example `bolt.yaml` with the settings modified:
259+
260+
``` yaml
261+
---
262+
pcp:
263+
# 2 hours = 120 minutes = 7,200 seconds
264+
job-poll-timeout: 7200
236265
```
237266

267+
For a complete reference of the available settings for the `pcp` transport see
268+
[bolt configuration reference](https://puppet.com/docs/bolt/latest/bolt_configuration_reference.html)
269+
documentation.
270+
238271
## Configuration Options
239272

240273
This module allows many aspects of its runtime to be customized using configuration options
241274
in the inventory file.
242275

243276
For details on all of the available configuration options, see [REFERENCE_CONFIGURATION.md](REFERENCE_CONFIGURATION.md)
244277

245-
Example: Let's say we want to prevent some nodes from rebooting during patching.
278+
Example: Let's say we want to prevent some targets from rebooting during patching.
246279
This can be customized with the `patching_reboot_strategy` variable in inventory:
247280
248281
``` yaml

0 commit comments

Comments
 (0)