informatiquecdc.win_pending_reboot
win_pending_reboot - 检查待处理的Windows重启
简介
- 这个Ansible模块检查Windows Server的三个特定注册表位置,以判断是否有重启待处理。
参数
参数 | 选择/默认值 | 备注 |
---|---|---|
skip_component_based_servicing 布尔值 |
选择:
|
指定是否跳过由基于组件的服务组件触发的重启 |
skip_windows_update 布尔值 |
选择:
|
指定是否跳过由Windows更新触发的重启 |
skip_pending_file_rename 布尔值 |
选择:
|
指定是否跳过待处理文件重命名的重启 |
skip_pending_computer_rename 布尔值 |
选择:
|
指定是否跳过由待处理计算机重命名触发的重启 |
skip_ccm_client_sdk 布尔值 |
选择:
|
指定是否跳过由ConfigMgr客户端触发的重启 |
示例
---
- hosts: localhost
roles:
- win_pending_reboot
tasks:
- name: 获取待处理重启状态
win_pending_reboot:
skip_ccm_client_sdk: no
register: test_pending_reboot_result
- name: 如果需要则重启
win_reboot:
when: test_pending_reboot_result.reboot_required
返回值
常见的返回值已在这里记录,以下是此模块特有的字段:
键 | 返回值 | 描述 |
---|---|---|
component_based_servicing 布尔值 |
成功 | 当基于组件的服务请求重启时返回True 。示例: False |
windows_update 布尔值 |
成功 | 当Windows更新请求重启时返回True 。示例: False |
pending_file_rename 布尔值 |
成功 | 当待处理文件重命名触发重启时返回True 。示例: False |
pending_computer_rename 布尔值 |
成功 | 当待处理计算机重命名触发重启时返回True 。示例: False |
ccm_client_sdk 布尔值 |
成功且_skip_ccm_client_sdk_ = no |
当ConfigMgr客户端触发重启时返回True 。示例: False |
reboot_required 布尔值 |
成功 | 当目标服务器需要重启时返回True 。示例: True |
注意事项
- 此模块使用了一些来自以下来源的开源函数的部分或全部:
- xPendingReboot https://github.com/PowerShell/xPendingReboot.git
- ansible-windows-pending-reboot https://github.com/valerius257/ansible-windows-pending-reboot
作者
- Stéphane Bilqué (@sbilque)
许可证
该项目以MIT许可证发布。
请查阅LICENSE查看完整文本。