Skip to content

Commit

Permalink
win_updates - change progress handler
Browse files Browse the repository at this point in the history
Changes the win_updates progress handler to use an ephemeral named pipe
instead of temporary files. This should fix up problems with the action
plugin trying to cleanup the file on a failure as there is now nothing
to cleanup.

The logging mechanism for the module has also been expanded to cover
more scenarios around the background process that was missing before.
This should make it more viable to debug failing scenarios than it was
before.

More error handling around broken connections or other connection
problems that installing updates can introduce have been added. It
should make the update process more resiliant than before.
  • Loading branch information
jborean93 committed Aug 10, 2023
1 parent b31fb08 commit 12b72af
Show file tree
Hide file tree
Showing 18 changed files with 1,278 additions and 936 deletions.
312 changes: 85 additions & 227 deletions plugins/action/win_updates.py

Large diffs are not rendered by default.

1,225 changes: 904 additions & 321 deletions plugins/modules/win_updates.ps1

Large diffs are not rendered by default.

28 changes: 24 additions & 4 deletions plugins/modules/win_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,19 @@
according to the PowerShell regex rules.
type: list
elements: str
_output_path:
_operation:
description:
- Internal use only.
type: str
_wait:
choices:
- start
- cancel
- poll
default: start
_operation_options:
description:
- Internal use only.
type: bool
default: no
type: dict
notes:
- M(ansible.windows.win_updates) must be run by a user with membership in the local Administrators group.
- M(ansible.windows.win_updates) will use the default update service configured for the machine (Windows Update, Microsoft Update, WSUS, etc).
Expand All @@ -121,6 +125,11 @@
found at U(https://technet.microsoft.com/en-us/library/2007.11.powershell.aspx).
- The current module doesn't support Systems Center Configuration Manager (SCCM).
See U(https://github.com/ansible-collections/ansible.windows/issues/194)
- By default the C(ansible.builtin.ssh) connection plugin is configured to have
no server timeout. As Windows Updates can restart the network adapter it is
recommended to set C(-o ServerAliveInterval=30) and disable control master
in I(ansible_ssh_args) to ensure the client can handle a network reset.
See the examples showing one way this can be set.
seealso:
- module: chocolatey.chocolatey.win_chocolatey
- module: ansible.windows.win_feature
Expand All @@ -136,6 +145,17 @@
category_names: '*'
reboot: true
- name: Set a server alive interval during update stage for the ssh connection plugin
ansible.windows.win_updates:
category_names: '*'
reboot: true
vars:
# This can be set in a few ways, see the ssh connection plugin for more
# information. ControlMaster should be disabled to ensure the new timeout
# value is applied for this connection instead of through the cached
# connection.
ansible_ssh_args: -o ControlMaster=no -o ServerAliveInterval=30
- name: Install all security, critical, and rollup updates without a scheduled task
ansible.windows.win_updates:
category_names:
Expand Down
Loading

0 comments on commit 12b72af

Please sign in to comment.