Windows: add Beszel agent update playbook; tolerate pending-restart blocks
- windows/update-beszel.yaml: scoop update of beszel-agent with NSSM service stop/start - windows/update.yaml: with reboot=false, don't fail on updates blocked by a pending restart (WU_E_INSTALL_NOT_ALLOWED); report installed vs not installed Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
fe3119cfaf
commit
011d427182
2 files changed
+65
-4
No files matched your search
+11
-4
@@ -42,12 +42,19 @@
|
||||
reboot_timeout: 3600
|
||||
register: result
|
||||
when: not search_only | bool
|
||||
# With reboot=false, updates blocked by the pending restart (WU_E_INSTALL_NOT_ALLOWED)
|
||||
# are expected; only fail on other errors.
|
||||
failed_when: >-
|
||||
result.failed_update_count | default(0) | int > 0 and
|
||||
(reboot | bool or
|
||||
result.updates | dict2items | map(attribute='value')
|
||||
| selectattr('failure_hresult_code', 'defined')
|
||||
| rejectattr('failure_hresult_code', 'equalto', 2149842966) | list | length > 0)
|
||||
|
||||
- name: Report
|
||||
ansible.builtin.debug:
|
||||
msg:
|
||||
- "Installed: {{ result.installed_update_count }}"
|
||||
- "Failed: {{ result.failed_update_count | default(0) }}"
|
||||
- "Reboot still required: {{ result.reboot_required }}"
|
||||
- "{{ result.updates | dict2items | map(attribute='value.title') | list }}"
|
||||
- "Installed: {{ result.updates | dict2items | map(attribute='value') | selectattr('installed') | map(attribute='title') | list }}"
|
||||
- "Not installed: {{ result.updates | dict2items | map(attribute='value') | rejectattr('installed') | map(attribute='title') | list }}"
|
||||
- "Reboot still required: {{ result.reboot_required }}{{ ' - reboot and re-run to finish' if result.reboot_required else '' }}"
|
||||
when: not search_only | bool
|
||||
Reference in new issue
Block a user