Ansible.Windows 3.8.0 - Whats New and How to Test
Introduction
ansible.windows is the Ansible Content Collection that ships the core modules and plugins used to manage Windows hosts over WinRM (and PSRP), including file operations, service management, updates, and the win_* family of modules that most Windows-focused playbooks depend on. Version 3.8.0 has just been published to Ansible Galaxy and introduces a new module, two minor feature additions, and one bugfix. This is the first tracked release for this collection on ansiblebyexample.com, so there is no direct comparison against a previous known version, but the changelog for this exact release is detailed below.
Whats New
New Modules
win_reboot_info- a new module that retrieves reboot status information for a Windows host. This is useful for checking pending reboot state (e.g. after patching or feature installation) without having to shell out to registry checks manually.
Minor Changes
win_copy- diff support has been added when copying single files. Running with--diffwill now show the actual file differences for single-file copy operations performed bywin_copyandwin_template. Copying multiple files at once still does not produce diff output. See issue #16.win_updates- a newmaximum_retries_on_failed_updatesoption has been added to control how many attempts the module makes at installing an update that has been rolled back. This addresses issue #762, where a single failed/rolled-back update could otherwise block the update run.
Bugfixes
win_copy- fixed an error that occurred whendestwas set to just a filename with no path. In that case the destination is now correctly resolved relative to the working directory set by the connection plugin, instead of raising an error.
Whats Changed at a Glance
| Component | Type | Change |
|---|---|---|
| win_reboot_info | New module | Get reboot status information for a Windows host |
| win_copy | Feature | Diff support for single-file copies |
| win_updates | Feature | maximum_retries_on_failed_updates option |
| win_copy | Bugfix | Fixed error when dest is just a filename |
How to Install and Test
Install or upgrade the collection from Ansible Galaxy and confirm the version and new module are available:
# Install the collection at the exact version
ansible-galaxy collection install ansible.windows:==3.8.0
# Or upgrade to the latest available version
ansible-galaxy collection install ansible.windows --upgrade
# Verify the installed version
ansible-galaxy collection list ansible.windows
# Confirm the new win_reboot_info module is available
ansible-doc ansible.windows.win_reboot_info
# Quick smoke test against a Windows host in inventory
ansible windows_host -m ansible.windows.win_reboot_info -i inventory.ini
# Test the new diff support on a single-file copy
ansible windows_host -m ansible.windows.win_copy \
-a "src=./notes.txt dest=C:\\Temp\\notes.txt" \
--diff -i inventory.ini
After upgrading, review any playbooks that rely on win_updates and consider setting maximum_retries_on_failed_updates explicitly if the environment has previously seen updates get stuck in a rolled-back state. Playbooks using win_copy with a bare filename in dest should also be re-tested to confirm the corrected destination resolution matches expectations.